Jump to content

Template talk:Lang

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Langx)

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]

When looking at the language codes for Standard Chinese, no ISO 639-3 code is provided, and none of the ISO 639-6 codes work. What codes should be used? Do the ISO 639-6 codes need to be added? Element10101 AIW WPI TOLT ~ C 19:21, 16 June 2025 (UTC)[reply]

The ISO 639-6 standard has been withdrawn and is not included in the IANA language-subtag-registry file. Browsers and screen readers use the data defined in the language-subtag-registry file to properly render and/or pronounce non-English text. For them to do that, {{lang}}, {{langx}}, and other templates must use the same data to markup non-English text at en.wiki.
Since Standard Chinese appears to be a descendant of Mandarin Chinese, you might use cmn{{lang|fn=name_from_tag|cmn}} → Mandarin Chinese.
Trappist the monk (talk) 22:55, 16 June 2025 (UTC)[reply]
Thanks, I used this to fix an error at Cross-linguistic onomatopoeiae#Human sounds. Element10101 AIW WPI TOLT ~ C 00:56, 17 June 2025 (UTC)[reply]

Mention how to get both words linked

[edit]

I did it! I figured out how to turn low performing

Russian: тундра

into superpowered

Russian: тундра

with both words linked!

I used

{{Langx|ru|[[ru:тундра|]]}}

And maybe you will need two colons sometimes: {{langx|zh|[[:zh:冬荫功|]]}}, giving Chinese: 冬荫功.

Jidanni (talk) 00:22, 13 July 2025 (UTC)[reply]

That should never be used. If an article exists in the English language there is never a reason to link to another language. If you need to link to a Wiktionary translation of the word, then use {{wikt-lang}}. Gonnym (talk) 11:07, 13 July 2025 (UTC)[reply]

Update to 2025-06-23

[edit]

https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry was last updated on 2025-06-23 but the module does not still understand de-viennese (test: German: Weanarisch, Weanerisch ) Can you update it? -- Error (talk) 11:06, 15 July 2025 (UTC)[reply]

[edit]

I don't really understand the rationale for this prescription in the documentation:

Do not write:
 {{lang|grc|[[wikt:Κλεοπάτρα#Ancient Greek|Κλεοπάτρα]]|nocat=yes}}
The words 'wikt' and 'Ancient Greek' are not Ancient Greek words so do not belong in the same markup as the Ancient Greek word Κλεοπάτρα.

This doesn't really make any sense: the point of these language tags is to ensure that the text is properly-formatted in the output HTML (i.e. the page that a user's browser will load). Due to the way links are processed on MediaWiki, the text in the link target (i.e. wikt:Κλεοπάτρα#Ancient Greek) will never be treated as tagged text in the final output, because it's strictly part of the link, so it doesn't matter what kind of text is in there. Here is the actual HTML output:

<span title="Ancient Greek (to 1453)-language text">
	<span lang="grc">
		<a href="https://en.wiktionary.org/wiki/%CE%9A%CE%BB%CE%B5%CE%BF%CF%80%CE%AC%CF%84%CF%81%CE%B1#Ancient_Greek" class="extiw" title="wikt:Κλεοπάτρα">
			Κλεοπάτρα
		</a>
	</span>
</span>

If you compare this to the prescribed form [[wikt:Κλεοπάτρα#Ancient Greek|{{lang|grc|Κλεοπάτρα|nocat=yes}}]], it's easy to see how it makes no functional difference which way round it is:

<a href="https://en.wiktionary.org/wiki/%CE%9A%CE%BB%CE%B5%CE%BF%CF%80%CE%AC%CF%84%CF%81%CE%B1#Ancient_Greek" class="extiw" title="wikt:Κλεοπάτρα">
	<span title="Ancient Greek (to 1453)-language text">
		<span lang="grc">
			Κλεοπάτρα
		</span>
	</span>
</a>

Could we please remove the prescription? Theknightwho (talk) 21:16, 15 July 2025 (UTC)[reply]

Given the lack of response, I'm going to remove this. Theknightwho (talk) 19:46, 28 August 2025 (UTC)[reply]

Edit request 14 August 2025

[edit]

Description of suggested change: Requesting edit to Module:Lang/data/iana languages - switching use of outdated name for an indigenous language to the autonym now found more commonly in recent literature (Camsá -> Kamëntšá), consistent with the article titles on Wikipedia (Kamëntšá people, Kamëntšá language)

Diff:

["kbh"] = {"Camsá"}
+
["kbh"] = {"Kamëntšá"}

 Vanilla  Wizard 💙 19:29, 14 August 2025 (UTC)[reply]

 Completed. P.I. Ellsworth , ed. – welcome! – 21:49, 14 August 2025 (UTC)[reply]

arx, Aruá (Rodonia State)

[edit]

"Rodonia" appears to be a typo in https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry , our source for Module:Lang/data/iana languages.

The state is Rondônia, and the language article is at Aruá language (Rondônia). {{Infobox language}} currently generates Category:Articles containing Aruá (Rodonia State)-language text, and the point at issue is moving this to Category:Articles containing Aruá (Rondonia State)-language text.

May we edit our module page and request a correction to the IANA page? – Fayenatic London 08:05, 31 August 2025 (UTC)[reply]

IANA gets its language names from ISO 639. The ISO 639 custodian lists the language name for arx as Aruá (Rodonia State). Apparently there was a a change from Aruá to Aruá (Rodonia State) in 2008 but I can't find the change request that caused that. Regardless, if you want to change the source from Aruá (Rodonia State) to Aruá (Rondônia State) or some other name you must take that up with the ISO 639 custodian.
I have overridden the IANA-supplied name to use the 'Rondonia State' disambiguator:
{{lang|fn=category_from_tag|arx |link=yes}}Category:Articles containing Aruá (Rondonia State)-language text
Trappist the monk (talk) 13:10, 31 August 2025 (UTC)[reply]
Brilliant, thank you! – Fayenatic London 21:23, 31 August 2025 (UTC)[reply]
The link produced by {{lang|fn=name_from_tag|arx|link=yes}}Aruá should be fixed from the dab page it currently leads to. Gonnym (talk) 05:44, 9 September 2025 (UTC)[reply]

Khorezmian dab

[edit]

Similar to the Ligurian dab issue in Archive 9, Khorezmian language is a 2-link dab between the 13th–14th-century literary Turkic language Khorezmian Turkic (ISO 639-3 zkh, "Khorezmian") and the 6th–11th-century Iranian language Khwarezmian language (ISO 639-3 xco, "Chorasmian").

I've added lines to override in Module:Lang/data/sandbox and to article_name in Module:ISO 639 name/ISO 639 override/sandbox, but it doesn't work if I preview it against User:OwenBlacker/sandbox. I've clearly done something wrong, but I can't see what. Anyone able to see where I messed up? — OwenBlacker (he/him; Talk) 13:59, 11 September 2025 (UTC)[reply]

Two things. At some point in the past, the automatic sandbox detector and switch code for the data modules disappeared from Module:Lang/sandbox so that module does not load Module:Lang/data/sandbox but instead, loaded Module:Lang/data. The second is that the template that you wrote in User:OwenBlacker/sandbox calls the live version of {{langx}} which calls Module:Lang which in turn loads Module:Lang/data so {{langx}} rendered a link to the dab because Module:Lang/data did not have your change.
I have added zkh to Module:Lang/data:
{{lang|fn=name_from_tag|zkh|link=yes}}Khorezmian Turkic
{{lang|fn=category_from_tag|zkh|link=yes}}Category:Articles containing Khorezmian Turkic-language text
I will leave it to you to create the required category.
I will reinstate the automatic sandbox detector and switch code for the data modules.
Trappist the monk (talk) 14:49, 11 September 2025 (UTC)[reply]
Thank you @Trappist the monk; you're the best! — OwenBlacker (he/him; Talk) 12:01, 14 September 2025 (UTC)[reply]

Maldivian language font

[edit]

May be a strange ask but I figured I'd ask out of curiosity but is it possible for both the Lang and Langx template to output the 'Faruma' font for any Maldivian text when specified as dv? 69.94.40.145 (talk) 11:24, 24 September 2025 (UTC)[reply]

No. But for registered users, see Template:Lang § Applying styles.
Trappist the monk (talk) 13:43, 24 September 2025 (UTC)[reply]

ISO 639-3 code "scz" not recognized

[edit]

See my sandbox.

  • ISO says scz exists. I see that it says "2025-10-15" as the effective date.
  • ISO 639:s says scz exists and maps to Shetland dialect.
  • My sandbox says "Error: {{Lang}}: unrecognized language code: scz"
  • The automatic template at {{User scz-5}} complains that scz is not valid.

Is this something that I can fix myself? – Jonesey95 (talk) 05:25, 18 October 2025 (UTC)[reply]

Module:Lang relies on the IANA language-subtag-registry file which they last updated 2025-08-25 so it won't show recent additions to ISO 639-3. I suppose that if you desperately need scz right now, you can manually add it to Module:Lang/data/iana languages. Presumably, scz will be included in the next IANA update.
I have updated the ISO 639-3 data:
{{ISO 639 name|scz}} → Shaetlan
Trappist the monk (talk) 14:02, 18 October 2025 (UTC)[reply]

Error ?

[edit]

{{langx|grc|}} renders the text inappropriately when an asterisk is used, as can presently be seen on the page Awarikus. Can this issue be fixed? Antiquistik (talk) 13:48, 19 October 2025 (UTC)[reply]

The issue is not with that template. It's with the {{script}} template. Gonnym (talk) 13:58, 19 October 2025 (UTC)[reply]
What it really comes down to is T14974. MediaWiki winds up inserting a newline before the asterisk as the parameter makes its way through {{script}}. The simplest workaround would probably just be to pass &#42;Εϝαρχος to {{script}} instead of *Εϝαρχος. Anomie 14:37, 19 October 2025 (UTC)[reply]
@Anomie Can this issue instead be fixed more durably? Antiquistik (talk) 18:15, 19 October 2025 (UTC)[reply]
Someone would have to rewrite all the subtemplates of {{script}} to avoid constructs like {{safesubst:<noinclude/>#if:{{{2|}}}|{{{2}}}|{{{1}}}}} where the value of a parameter is the first part of the value output from a template or parser function, maybe by doing it like {{safesubst:<noinclude/>#if:{{{2|}}}|<nowiki/>{{{2}}}|<nowiki/>{{{1}}}}} instead for that example. Anomie 22:21, 19 October 2025 (UTC)[reply]
In some cases, {{Encodefirst}} can be used to ensure that the first character is rendered as intended. I don't know if this is one of those cases. I have added it to a few templates with good results. – Jonesey95 (talk) 00:18, 20 October 2025 (UTC)[reply]
Alternately, don't put the splat inside {{script/Grek}}:
{{lang|grc|*{{script/Grek|Εϝαρχος}}}}*Εϝαρχος – creates a tool tip that describes the text, not as Ancient Greek but as Polytonic Greek; not sure that {{script/Grek}} should be doing that
or, wrap {{lang}} in {{script/Grek}}:
{{script/Grek|{{lang|grc|*Εϝαρχος}}}}*Εϝαρχος – creates a tool tip that describes the text as Ancient Greek; not for {{langx}}
Trappist the monk (talk) 00:51, 20 October 2025 (UTC)[reply]
@Trappist the monk The template was not doing this until some days ago, meaning it must have recently been modified to do so. Can't the tampering be undone? Antiquistik (talk) 03:20, 23 October 2025 (UTC)[reply]
This edit to {{Script/Greek}}, made without a discussion or edit summary, appears to have caused the problem. I tested the previous version using {{script/sandbox}} and there were no line breaks. I have reverted. importScript('User:Anomie/previewtemplatelastmod.js'); in my common.js file was useful for finding out which templates had changed recently. – Jonesey95 (talk) 04:19, 23 October 2025 (UTC)[reply]
@Jonesey95 Thanks! Antiquistik (talk) 05:56, 23 October 2025 (UTC)[reply]

Comparison with the Lang template

[edit]

The {{lang}} template does not support |translation=; § Comparison with the Lang template should mention that. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 09:48, 23 October 2025 (UTC)[reply]