This template is within the scope of WikiProject Languages, a collaborative effort to improve the coverage of languages on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.LanguagesWikipedia:WikiProject LanguagesTemplate:WikiProject Languageslanguage
Template:Lang is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This template was considered for deletion on 2006 February 20. The result of the discussion was "keep".
To help centralize discussions and keep related topics together, the talk pages for all help pages, categories, MediaWiki messages and templates related to Template:Lang redirect here.
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.
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]
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:
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.
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]
Removing the prescription not to put links inside the template
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:
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:
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)
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:
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.