Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a4009e3ae8deee32

Jump to content

Template talk:Lang

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Lang/documentor tool/doc)
Latest comment: 18 hours ago by Jonesey95 in topic Spelling override

Lang-rus merge

[edit]

At Wikipedia:Templates for discussion/Log/2025 April 17#Template:Lang-rus it was proposed to replace {{Lang-rus}} with {{lang}} and {{langx}} templates. The discussion ended with the result of merging the features of {{Lang-rus}}, which mostly means enabling {{lang}} to have access to the additional features {{langx}} has leaving the only difference between the two templates the language name appearance vs tooltip. The only parameter left that both don't use is an IPA parameter, but since both don't use it, this could probably either be handled as we do now, or added as a new feature. Gonnym (talk) 08:30, 15 May 2025 (UTC)Reply

Agreed. Gommeh ➡️ Talk to me 19:52, 15 May 2025 (UTC)Reply
@Trappist the monk: is this something you could look into? Been over a year since this TFD was closed as merge. Would be great to get some forward progress if you have time! Zackmann (Talk to me/What I been doing) 05:50, 20 May 2026 (UTC)Reply
{{lang-rus}} is just a wrapper template around {{language with name}} (which wraps {{lang}}), {{transliteration}}, and {{IPA}}. {{lang-rus}} could be simplified somewhat by replacing:
{{Language with name|ru|Russian|links={{{links|no}}}|{{{1|}}}|italic={{{italic|unset}}}}}{{#if:{{{r|{{{2|}}}}}}|, <small>[[Romanization of Russian|romanized]]:</small> {{Transliteration|ru|{{{r|{{{2}}}}}}}}}}
with:
{{langx|code=ru|links={{{links|no}}}|italic={{{italic|}}}|text={{{1}}}|translit={{{r|{{{2|}}}}}}}}
Trappist the monk (talk) 16:51, 26 May 2026 (UTC)Reply
The TfD resulted in deletion of that template, not turning it into a wrapper. Also, Russian isn't the only language that is doing hacks to get langx capabilties when using lang. Gonnym (talk) 18:02, 26 May 2026 (UTC)Reply
From this November 2009 version, {{lang-rus}} has always been a wrapper template. Simplifying as I described above is not turning it into a wrapper.
Trappist the monk (talk) 11:29, 27 May 2026 (UTC)Reply
The wrapper discussion while interesting is irrelevant to the TfD result and the above request. I've fixed enough usages of lang/langx templates to know that editors want langx options available for lang usages. There really is no reason to have this distinction other than inertia. Gonnym (talk) 19:10, 27 May 2026 (UTC)Reply

Template-protected edit request on 23 April 2026

[edit]

The values ca and us for the {{{engvar}}} parameter are redundant, as they do not change the spelling of “romanized.” I suggest we remove them. 2600 etc (talk) 01:17, 23 April 2026 (UTC)Reply

Not done. As a convenience to editors, the value assigned to |envar= should match the article's {{use <country> English}} template.
Trappist the monk (talk) 12:38, 26 April 2026 (UTC)Reply

Font

[edit]

Why does this output the heading "Ancient Greek" in a weird serif font? ~2026-26990-82 (talk) 02:28, 10 May 2026 (UTC)Reply

Can't read your mind. When you encounter an issue, always say where you are seeing it; always.
For me, this:
{{langx|grc|Κλεοπάτρα}}Ancient Greek: Κλεοπάτρα
renders correctly.
Trappist the monk (talk) 02:40, 10 May 2026 (UTC)Reply
Here's an example, but with Chinese instead: French_cruiser_Villars#Battle_of_Fuzhou. Any idea why the template randomly seems to change fonts for some languages? Parsecboy (talk) 18:44, 11 June 2026 (UTC)Reply
Copy the specific code here please. Gonnym (talk) 19:01, 11 June 2026 (UTC)Reply
You mean these ship names?
{{lang|zh|Zhenwei}}, {{lang|zh|Feiyun}}, and {{lang|zh|Ji'an}}
Your browser chooses a font according to the language tag. You are telling the browser that these ship names are written in the Chinese language (zh) so your browser applies a font that it believes to be correct for that language. But, the ship names are not written using a Chinese script. Rather, they are written using the Latn script. Compare:
Zhenwei, Feiyun, and Ji'an{{lang|zh|Zhenwei}}, {{lang|zh|Feiyun}}, and {{lang|zh|Ji'an}} – Latn script using a Chinese font
Zhenwei, Feiyun, and Ji'an{{lang|zh-latn|Zhenwei}} {{lang|zh-latn|Feiyun}} and {{lang|zh-latn|Ji'an}} – Latn script using a Latn font
Zhenwei, Feiyun, and Ji'an''Zhenwei'', ''Feiyun'', and ''Ji'an'' – Latn script using the default font
The second form should force your browser to use the same font as the article uses (third form).
Trappist the monk (talk) 19:18, 11 June 2026 (UTC)Reply
Thanks, Trappist - I figured there was a parameter I could tweak to fix it, but couldn't figure it out from the documentation. Parsecboy (talk) 19:39, 11 June 2026 (UTC)Reply
@Trappist the monk Just as an FYI, appending -Latn does not always force the browser to use the same font as the rest of the article, but rather it forces whichever font the browser associates with that particular language in the Latin script. This is relevant for Chinese, where monospaced fonts are sometimes preferred (or at least they used to be). Theknightwho (talk) 13:24, 14 July 2026 (UTC)Reply

Feature request: Module:Lang support for {{Lang(x)}} to recognize CLCR codes (qXX) or long codes (art-x-X*)

[edit]

This may exist as a separate template, but I don't know of a way to tag conlanguage text in this manner (and if it isn't and this feature isn't possible/practical, I'd be happy to create and upkeep that new template if I could get some advice!). —It's Okkirae.temp ('Sup?)! 01:41, 22 May 2026 (UTC)Reply

Long-form CLCR language tag support is available though, at the moment, only art-x-uropi is defined:
{{lang|fn=name_from_tag|art-x-uropi|link=yes}}Uropi
{{lang|fn=category_from_tag|art-x-uropi|link=yes}}Category:Articles containing Uropi-language text
Trappist the monk (talk) 17:00, 26 May 2026 (UTC)Reply
Is it possible/proper to define the rest of them? Okkirae∤(±) 18:31, 26 May 2026 (UTC)Reply
Possible? Yes. Proper? Probably not. If you have a need for a CLCR language tag, it can be added.
Trappist the monk (talk) 11:33, 27 May 2026 (UTC)Reply
Is there a way for myself to create a fork of the Lang template for this purpose? I'm new to template coding but determined. Okkirae∤(±) 14:16, 27 May 2026 (UTC)Reply
At en.wiki, template forking is discouraged. If you need CLCR language tags, they can be added.
Trappist the monk (talk) 14:29, 27 May 2026 (UTC)Reply
Alright, thanks anyway. Okkirae∤(±) 01:51, 30 May 2026 (UTC)Reply

Edit request

[edit]

Change Patani Malay > Kelantan–Pattani Malay coz the former redirects to Patani Malays. Ahri Boy (talk) 09:47, 30 May 2026 (UTC)Reply

Module:Lang does not recognize 'Patani Malay':
{{lang|Patani Malay|fn=tag_from_name}}Error: language: Patani Malay not found
Perhaps you meant to write 'Pattani Malay'. Module:Lang recognizes that name but it does not create links to Patani Malays:
{{lang|Pattani Malay|fn=tag_from_name}}mfa{{lang|mfa|fn=name_from_tag|link=yes}}Pattani Malay[[Pattani Malay language|Pattani Malay]] (a redirect to Kelantan–Pattani Malay)
At this edit, Editor The Bangsawan changed the redirect target from Kelantan–Pattani Malay to Patani Malays. For most of its existence, the Patani Malay redirect has pointed to the language article, not the ethic group article. If there is an issue with the Patani Malay redirect, you should take up that issue with Editor The Bangsawan.
Trappist the monk (talk) 13:10, 30 May 2026 (UTC)Reply
Thank you for adding the header on the article Ahri Boy. د بڠساون (talk) 04:46, 5 June 2026 (UTC)Reply


Errors for writing Greek in roman alphabet

[edit]

It appears from the writeup of template:lang that something {{lang|grc|JJJQJ}} (picking latin letters as far as way from greek letters as possible) should generate *some* level of error. I've got quite a few similar examples in mainspace and I'm not seeing any errors or any invisible categories for it.Naraht (talk) 17:21, 10 June 2026 (UTC)Reply

For the example that you give, there should be no errors:
{{lang|grc|JJJQJ}}<span title="Ancient Greek (to 1453)-language text"><i lang="grc">JJJQJ</i></span>JJJQJ
What exactly makes you think that there should be errors? Where exactly are you expecting to see these errors?
Trappist the monk (talk) 17:30, 10 June 2026 (UTC)Reply
I think they meant that if you use Greek words then they should be written in Greek alphabet and not in Latin alphabet. If this error check can happen, it should probably be for other non-Latin langauges (he, ar, etc.) Gonnym (talk) 18:28, 10 June 2026 (UTC)Reply
That is what I meant. From the writeup of the template, I expected something to be generated in that case. I know that there are a *few* languages equally appropriate to put multiple character sets (Serbo-Croatian is one if you consider it one language, and I think a few of the post-soviet stans both use their 19th century script and either Cyrillic or Roman) but in my mind the example above should generate *something* that can be set to be seen by an experienced editor. I still haven't made up my mind if something like {{lang|grc|Philia}} should become {{lang|grc-latn|Philia}} or {{transl|grc|Philia}}, that is a place I have a hard time judging. For *now*, I'm looking for insource:/lang\|grc\|[a-z]/i , but I know that isn't the end of the issue. (looking for a greek letter and a latin letter next to each other gets a *lot* of hits, ranging from ΦBK to all greek words where the writer is using a Latin C in place of a Capital lunate Sigma.Naraht (talk) 02:40, 11 June 2026 (UTC)Reply

Template-protected edit request on 24 June 2026

[edit]

In the "When using {{lang}} with non-English wiktionary links" part, include something like "{{wikt-lang}} is a template to do this". For example, maybe place that exact verbiage after the example, or perhaps make that first bit "When using {{lang}} with non-English wiktionary links (see {{wikt-lang}}): " Dingolover6969 (talk) 22:11, 24 June 2026 (UTC)Reply

 Not done: according to the page's protection level, you should be able to edit the page yourself. If you seem to be unable to, please reopen the request with further details.Jonesey95 (talk) 22:15, 24 June 2026 (UTC)Reply
Oh, you're right. I was looking at the template itself, not its documentation page. Dingolover6969 (talk) 22:19, 24 June 2026 (UTC)Reply

styling of japanese romaji

[edit]

nurikabe (ja) is written in some weird font (at least on my browser) but, eg, nurikabe (fr) is written normal. The former is undesirable. It seems ja-Latn fixes the problem nurikabe, but couldn't this be done automatically? This is a low priority request and I'm not going to personally fix it, to be sure. Dingolover6969 (talk) 22:18, 24 June 2026 (UTC)Reply

ill-lang?

[edit]

I've started a discussion about potential "ill-lang" functionality over at Template_talk:Interlanguage_link#ill-lang?, feel free to join in. Dingolover6969 (talk) 01:47, 2 July 2026 (UTC)Reply

Protected edit request on 14 July 2026

[edit]

Current version of Module:Lang:

local function make_error_span (template, msg)
	return table.concat ({'<span style="color:var(--color-error,#d33)">', cfg.misc_text_t.error, ': ', template, msg, '</span>'})
end

Requested change:

local function make_error_span (template, msg)
	return table.concat ({'<span class="error" style="color:var(--color-error,#d33)">', cfg.misc_text_t.error, ': ', template, msg, '</span>'})
end

Rationale: the {{#iferror:}} parser function evaluates to true if the input string contains an HTML object with class="error". This change adds the class to any soft errors thrown by this module (listed at Category:Lang and lang-xx template errors).

I want to change some of the script-specific templates such as {{Script/Greek}} (which adds script styling) so that they call {{Lang}} if an optional language code has been provided. Since the script is the whole point of the template, it would first try calling Lang with the language code [langcode]-Grek, but this will raise a soft error if the language's default script is Grek, so I want to be able to fall back to calling Lang without the script code appended if that happens. Theknightwho (talk) 14:20, 14 July 2026 (UTC) Theknightwho (talk) 14:20, 14 July 2026 (UTC)Reply

Did you test this proposal? Where? If I write variations of the current and proposed markup to test the change, I get:
  • <span style="color:var(--color-error,#d33)">the current error message</span>the current error message
  • <span class="error" style="color:var(--color-error,#d33)">the proposed error message</span>the proposed error message
Trappist the monk (talk) 14:59, 14 July 2026 (UTC)Reply

Multiple languages support

[edit]

I think it would be beneficial to add the option for multiple iterations of the code parameter for labeling text with more than one language, something like (code1 = de|code2 = fr) that would render as "German and French: lorum ipsum" -- Lenny Marks (talk) 18:38, 20 July 2026 (UTC)Reply

This has come up before. See Template talk:Lang/Archive 14 § a way to mark something as being in multiple languages.
To add to the previous discussion, when you write:
{{langx|de|lorum ipsum}}
the template creates this html so that browsers choose a correct font and screen readers pronounce the text with the correct accents.
[[German language|German]]: <i lang="de">lorum ipsum</i>
html allows only one lang= attribute in an element (<i> in this case) so we cannot get html to tell browsers to render the text in different fonts nor tell screen readers to pronouncify lorum ipsum in both the German and French accents.
We do have {{native name list}} which can do this:
{{native name list |tag1=de |name1=lorum ipsum |tag2=fr |name2=lorum ipsum}}
Trappist the monk (talk) 19:13, 20 July 2026 (UTC)Reply

Translation

[edit]

Currently, the translation, lit, and 4 labels are equivalent, and always render translations as "lit. xxx". But many translations don't need to be tagged as literal. For example, there is no reason to write café au lait lit.'coffee with milk'; it suffices to write café au lait 'coffee with milk'. The "lit." annotation is appropriate where the idiomatic meaning is different from the literal translation, e.g., de rien lit.'of nothing', where the idiomatic meaning is "you're welcome" or "it's nothing". See also older discussions at Template_talk:Literal_translation: hide_"lit"_for_simple_glosses and Overuse_of_"lit.".

I suggest that translation, 4, and trans all produce the simple gloss form, and lit or literally produce the "lit." annotation. I understand that many existing pages will render differently, but that's probably a good thing -- "lit." is generally overused and even when it's appropriate, it shouldn't cause confusion to drop it. --Macrakis (talk) 16:45, 10 August 2026 (UTC)Reply

Edit request to complete TfD nomination

[edit]

Template:Langx has been listed at Templates for discussion (nomination), but it was protected, so it could not be tagged. Please add:

<noinclude>{{subst:tfm|help=off|1=Lang-ro-Cyrl}}</noinclude>

to the top of the page to complete the nomination. Thank you. LaundryPizza03 (d) 05:44, 23 August 2026 (UTC)Reply

 Completed. P.I. Ellsworth, ed.  welcome!  09:14, 23 August 2026 (UTC)Reply

Spelling override

[edit]

Does anyone know if there's a way to override the "Tetum" spelling used for the infobox at Tetun people? See the discussion at Special:PermanentLink/1351484656 that resulted in a move of all related pages. The tl;dr is they were previously colonized by Portugal, which for some reason uses the letter M in place of N, but it is pronounced with N and correctly spelled that way in the language itself and all others. This is the only mention that I can't fix since it isn't defined locally. ChompyTheGogoat [ Bleat | Munched ] 11:18, 14 September 2026 (UTC)Reply

{{lang|fn=name_from_tag|tet|link=yes}}Tetun
Trappist the monk (talk) 11:32, 14 September 2026 (UTC)Reply
Where do I insert that? I don't even know how the infobox is calling this template, because the parameters go directly from the (correctly spelled) native_name to image. ChompyTheGogoat [ Bleat | Munched ] 11:47, 14 September 2026 (UTC)Reply
(A number of other articles have the same problem too.) ChompyTheGogoat [ Bleat | Munched ] 11:50, 14 September 2026 (UTC)Reply
I don't know what someone did, but it appears to be fixed now! Hopefully the solution applies to all the affected pages. ChompyTheGogoat [ Bleat | Munched ] 12:12, 14 September 2026 (UTC)Reply
Can someone help me with this again? Now it's citation templates used in references on pages like List of secondary schools in Timor-Leste, defined as |language=tet, which displays as in Tetum. After the above request someone fixed it in some way that I don't understand as it's not defined locally (and they didn't reply to say they'd done so). They must have retargeted the source being used, but I don't know where or how. ChompyTheGogoat [ Bleat | Munched ] 04:50, 23 September 2026 (UTC)Reply
(The override above does appear to work, but if there's a global solution I'd much rather do that than insert bandaid fixes on a bunch of different pages.) ChompyTheGogoat [ Bleat | Munched ] 04:54, 23 September 2026 (UTC)Reply
It looks like we need another override at Module:Citation/CS1/Configuration. I have posted a request at Help talk:Citation Style 1. – Jonesey95 (talk) 14:34, 23 September 2026 (UTC)Reply

Edit request to complete TfD nomination_2

[edit]

Template:Langx has been listed at Templates for discussion (nomination), but it was protected, so it could not be tagged. Please add:

{{subst:tfm|help=off|1=Lang-ru}}

to the top of the page to complete the nomination. Thank you. Mupper-san (talk) 18:14, 18 September 2026 (UTC)Reply

 Completed. P.I. Ellsworth, ed.  welcome!  10:49, 20 September 2026 (UTC)Reply
Set |type=disabled. P.I. Ellsworth, ed.  welcome!  11:21, 20 September 2026 (UTC)P.I. Ellsworth, ed.  welcome!  11:21, 20 September 2026 (UTC)Reply

Edit request 20 September 2026

[edit]

Description of suggested change:

Can you change the discussion notice to something that appears inline like [citation needed] does?

Or shown only on {{lang-ru}} instead of both? ווסטוק (talk) 10:51, 20 September 2026 (UTC)Reply

You have to be specific for an edit request. Let us specifically request to remove the discussion notice from this template. NotBartEhrman (talk) 10:57, 20 September 2026 (UTC)Reply

Template:Langx broken with latest edit?

[edit]

It seems as if the most recent edit to Template:Langx, adding the nomination notice, has broken the template. For some examples, see Anatolia and Pavel Batov. Can someone with permissions and the know-how fix this? Oakchris1955 (talk) 11:05, 20 September 2026 (UTC)Reply