Share to: share facebook share twitter share wa share telegram print page

Template talk:Lang

Usage en masse

Hi everyone,

I would like to propose that in instances where you may need to translate a large amount of text strings from one language to another, maybe we should use a template that makes it a little bit easier to do so such as Template:Translation table. That template (albeit a WIP) calls the Langx template.

Here's an example of what I'm proposing:

Japanese Transliteration English
君が代は Kimigayo wa May your reign
千代に八千代に Chiyo ni yachiyo ni Continue for a thousand, eight thousand years
さざれ石の Sazare ishi no Until the tiny pebbles
巌となりて Iwao to narite Grow into massive boulders
苔の生すまで Koke no musu made Lush with moss


.

Thoughts? Gommeh ➡️ Talk to me 19:56, 11 May 2025 (UTC)[reply]

There isn't a lot of situations where a table like that is actually needed. The example you gave would be much better served with {{Verse transliteration-translation}}. Gonnym (talk) 11:00, 12 May 2025 (UTC)[reply]
Another place where we may want to use it is where we want to explain how languages work with examples, e.g.
Spanish English
yo tengo I have
tú tienes you have
él/ella tiene he/she has
usted tiene you (formal) have
nosotros tenemos we have
ellos/ellas/ustedes tienen they/you (plural) have


. Gommeh ➡️ Talk to me 12:10, 12 May 2025 (UTC)[reply]

Editor Gommeh: {{Translation table}} is broken badly here and in Law Concerning the Head of State of the German Reich and Nuremberg Laws. I know that it used to work here; can't say whether it ever worked at those two articles. The obvious first step is to make the module name match the template name...

Trappist the monk (talk) 19:20, 15 May 2025 (UTC)[reply]

Didnt realize there was a typo in there when I updated it, fixed. Thanks for bringing that up. Gommeh ➡️ Talk to me 19:48, 15 May 2025 (UTC)[reply]
and I can confirm it does work on those two articles. Gommeh ➡️ Talk to me 19:51, 15 May 2025 (UTC)[reply]

Lang-rus merge

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]

Option to use language codes instead of full language name

For situations where space is tight, it would be nice to have the option to indicate the use of language codes (probably ISO 639-3) instead of the written-out language name. DeklinCaban (talk) 13:42, 3 June 2025 (UTC)[reply]

Your post is somewhat vague. I presume that you are talking about {{langx}} which normally outputs a language-name label:
{{langx|es|casa}}Spanish: casa
If that is what you are talking about, the facility already exists:
{{langx|es|casa|label=[[Spanish language|es]]}}es: casa
Trappist the monk (talk) 13:47, 3 June 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

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

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]

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

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)

"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

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]
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya