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".
Usage
This template should not be used directly in individual articles. Instead, a template with the name lang-xx shold be created, where the xx is the ISO 639 language code. The contents of this template should take the form:
{{langWithName|xx|language-name|{{{1}}}}}
Where xx is again the ISO 639 code, and language-name is the name of the language.
In turn, when calling a lang-xx template, it should be called in the form:
This has to be some kind of record in meta-template harmfulness. I'm stunned that people would go to this much trouble, creating so many complicated templated just to avoid typing a few extra letters. In most cases the amount of characters saved is amazingly small and people actually use some of the sub-templates to replace existing links at times. Please don't create any more of these. Ever.
Please see related talk at template talk:lang-uk. These templates are useful and cause no harm, but are being unilaterally removed by this user. —MichaelZ. 2005-10-16 22:27 Z
ko:Template:Llang seems to achieve a similar effect by including ko:Template:언어 이름 (언어 이름 = “language name(s)”), but without the need of creating dozens of other templates. If you like its approach, perhaps something like that can replace this template and most lang-xx templates.—Wikipeditor05:44, 2 February 2006 (UTC)[reply]
No italics
I've created a variant, {{LangWithNameNoItals}}, to be used for languages whose writing systems do not lend themselves to being written in italics (Hebrew, East Asian languages, etc.) —Angr11:04, 17 January 2007 (UTC)[reply]
this template now forces no italics either. Italics are rather inserted in the "lang-xx" templates transcluding this one. dab(𒁳)10:34, 24 July 2007 (UTC)[reply]
Done. A lot of templates are protected here to prevent vandalism, since vandalism on templates can affect many pages. Many templates are being changed so the documentation and interwikis are on a subpage so they can be edited without administrator assistance, but this one hasn't been changed over yet. --- RockMFR23:21, 29 August 2007 (UTC)[reply]
It is now. RichFarmbrough, 22:54 17 December 2008 (UTC).
Bolding problem with this template.
See, for example, the Filipino language article. the relevant wikitext there is "'''Filipino language''' ({{lang-fil|Wikang Filipino}})", which renders here as "Filipino language ({{lang-fil|Wikang Filipino}})". However, in the Filipino language article, it renders improperly (and in violation ofWP:LEDE#Format of the first sentence, "do not boldface foreign names not normally used in English") as "Filipino language (Filipino: Wikang Filipino)". This is because this template tries to place a self-referential wikilink.
I added an optout, |links=no, to make this template not link the language names (should be useful in articles where you're using it over and over and there are overlinking concerns). To make it functional in the shell templates, however,
|links={{{links|yes}}}
or something alone those lines needs to be added to the templates that call this one. For example, I did this to a bunch of the Chinese templates; this make it so someone can use {{zh-sp|s=something|p=something|links=no}} and have it remove the links (for example, in the lede paragraph of Not One Less).
Anyway, whoever wants to help out is welcome to add this code to the other templates to expand the functionality of this, since there are thousands of these templates and I'm in no mood to do it to all of them (I basically just updated the few templates that I myself use). rʨanaɢtalk/contribs03:12, 17 September 2009 (UTC)[reply]
I don't know of a way to do something like that automatically, but I guess we could hard-code the language codes into this template for languages such as Latin ("la") so the "language" part doesn't show up in the link. However, I gotta ask if it's really that big of a deal and worth the hassle? As long as "Foo language" properly redirects to "Foo", what seems to be the problem?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); July 1, 2010; 17:58 (UTC)
For impetus, I thought we generally tried to fix, or avoid using, redirects in templates. Someone else had requested a fix at Template talk:Lang-la 2 years ago; I was seconding the query.
But you're probably right, that it's not worth adding extra template-complexity just to fix redirect(s).
Hmm, you are right about the redirects in templates... I forgot about that. Here's another suggestion then. Instead of overloading this template with the conditionals which will be processed every time but are only going to kick in for a handful of cases (such as Latin), why not copy this template verbatim to another title (such as {{LangWithShortName}}), tweak it so the "language" part doesn't show up, and have {{lang-la}} (and other similar templates, if someone can think of any) call it instead? Granted, we'll have two almost identical templates, but I think considering how heavily this template is used it would be an acceptable compromise?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); July 2, 2010; 02:01 (UTC)
Colon has to be escaped or definition lists get hosed
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
Please, ASAP, change the line:
}}: [{{{3}}}] Error: {{Lang}}: unrecognized language tag: {{{1}}} (help)<noinclude>
to
}}: [{{{3}}}] Error: {{Lang}}: unrecognized language tag: {{{1}}} (help)<noinclude>
Without this fix, this template cannot be used in ;/: wkimarkup definition lists without causing them to barf.
Test cases
Template structured glossary format
{{term|1=tyre |content={{lang-en-GB|tyre}}}}
{{term|1=tire |content={{lang-en-US|tire}}}}
{{defn|1=A resilient wheel covering usually made of vulcanized rubber.}}
A resilient wheel covering usually made of vulcanized rubber.
Results: YCorrect.
Manually-formatted wikimarkup
; [[British English]]: {{lang|en-GB|tyre}}
; [[American English]]: {{lang|en-US|tyre}}
: A resilient wheel covering usually made of vulcanized rubber.
Instead of having individual templates for every language transcluding this meta template we should have one template only with a parameter for language. As it stands now, if we add a parameter to this template, as I'm going to propose next, then each of the transcluding templates will have to be updated, including user instructions. That is exceedingly cumbersome and impractical. __meco (talk) 09:28, 20 April 2012 (UTC)[reply]
Request for added parameter
I propose a new parameter be added to this template, |silent=yes, which, when active, will cause the name of the language to be suppressed altogether. The cases where this would be used are when the foreign-language term precedes the English name. Then the only effect of using the template would be to categorize the article into the relevant multilingual support category.
A more neat solution to this would perhaps be to modify the existing |links= parameter to handle a different set of values. That would probably mean to give it a new name, e.g. |show=, with the possible values yes (default), unlink and no. This proposal must be seen in connection with my proposal for streamlining this scheme altogether in the previous section. __meco (talk) 09:39, 20 April 2012 (UTC)[reply]
I think I agree: Obviously the more obscure the language, the stronger the case for linking, especially if it is out of linguistic context. All the best: RichFarmbrough, 16:24, 4 July 2014 (UTC).
Suggestion: An optional literal translation
Hi,
I am an admin, so I can edit this template, but, since it is high use, I thought I should discuss my idea here first.
I think it would be really useful to be able to have an optional literal translation. Then we could have something like the following:
The Prime Minister of Italy (Italian: Presidente del Consiglio dei Ministri, literal translation: President of the Council of Ministers) is the head of government of the Italian Republic.
I am open to suggestion on formatting, for example we could have some kind of abbreviation.
I've done some work in the sandbox. What do we think of this?
{{Lang-it/sandbox|Presidente del Consiglio dei Ministri|lit=President of the Council of Ministers}}
For the benefit of future readers, I will subst the same wikicode below, so that people will know what the template looked like, if it is edited further.
Italian: [Presidente del Consiglio dei Ministri] Error: {{Lang}}: text has italic markup (help)literal translation: President of the Council of Ministers
Your subst is another sandbox... so I subt'd that! I think it is a good idea. Is it worth introducing a "link=yes" parameter which would make linking the language name default to no-link, per the above section? All the best: RichFarmbrough, 16:27, 4 July 2014 (UTC).
"literally" might be enough (or even "lit." if this were print). And one minor thing, I don't think "small" text is appropriate or needed. All the best: RichFarmbrough, 16:29, 4 July 2014 (UTC).
I have applied the change to Template:Language with name and Template:Lang-it. No one has objected to it. Is it time to roll out the change to all the other Lang-xx templates?
What do we think the best way of doing that is? A bot? AWB? One big push? Slowly but surely?
I would suggest doing half a dozen of the most common languages. This should encourage any criticism at the cost of little effort (and while reverting is easy). Give it a few days then use AWB for the rest. All the best: RichFarmbrough, 15:32, 15 August 2014 (UTC).
Some questions/suggestions regarding this template
If they don't (i.e. intentionally), would it be possible for them to all be converted to use it? That way, they would all get to use |links=.
While we're on it, could we supplement |links= with:
A parameter (something like |language=no) to avoid printing the language name altogether (useful if you're using more than one {{lang-fr}} or whatever in a row, giving you in read mode e.g. "This comes from the French: φ and χ", instead of "This comes from the French: φ and the French: χ")?
A parameter (something like |separator= ) to avoid the colon being printed after the name of the language (it might sometimes fit the sentence the template is embedded in better)?
In every Wikipedia context I've seen, the colon in this template is unnecessary, ugly, and different from the usual formatting in other printed matter. Can anyone point to examples in professionally typeset material that uses the colon? In all the books I've looked at recently, you see things like
Goal 1: This option is useful when the template (and so the language name)the language name is not to be repeated in a sentence, paragraph or table that has multiple elements of the same language, while the template should be used for its other functions. (rephrase -DePiep (talk) 16:13, 16 October 2014 (UTC))[reply]
There's a little annoyance that I have noticed. {{lang-la}} produces the redirecting link [[Latin language|Latin]], which redirects to Latin. It seems {{lang-la}} uses {{language with name}} to create the link. I don't understand how this template works, so I can't answer this question: Is there a way that {{language with name}} can be modified to produce the sequence [[x]] instead of [[x language|x]] in the cases of languages like Latin and Old English, whose article names do not end in language? — Eru·tuon02:32, 18 December 2014 (UTC)[reply]
There would be no advantage to this, since all the redirects are in place. The good sense is to keep the template as simple as possible to use and to maintain. All the best: RichFarmbrough, 23:27, 24 July 2015 (UTC).[reply]
@MSGJ:Thanks, I have not checked all, but the ones I have noted that needed to changed are as follows, the bold ones are those I wanted to change yesterday, but somehow missed: (harith (talk) 02:46, 29 September 2015 (UTC))[reply]
The abbreviation for "literally" should marked up semantically. The lightweight option is <abbr title="literally">lit.</abbr> which returns: lit.. A complete example would be: French: déjà vu, lit. already seen instead of French: déjà vu, lit. already seen Thoughts? —LLarson (said & done) 17:58, 21 January 2016 (UTC)[reply]
@SMcCandlish: I submitted this proposal almost three months ago and presented a modified sandbox with testcases almost three weeks ago and there have been no objections. Would you consider updating the template? —LLarson (said & done) 21:16, 12 April 2016 (UTC)[reply]
@LLarson: Done. Seems straightforward enough. We shouldn't add that around every abbreviation everywhere. We don't need it for "Dr[.]", for example, and it would be pointless if done to an abbr. used shortly after the expanded version, since it's already clear what it means in context. But it makes sense in a case like this, where it's usually the first (possibly only) occurrence on the page. The only downside I can think of is if it's used several times in the same block of text, e.g. to translate an English colloquial phrase into rough but not literal versions in 5 other languages. We don't do that often, though. — SMcCandlish ☺☏¢ ≽ʌⱷ҅ᴥⱷʌ≼ 21:00, 13 April 2016 (UTC)[reply]
Single quotes for value of "lit" parameter
Per MOS:SINGLE, it should also be generating single quotes around the gloss supplied in |lit= (i.e. appearing after the text "lit.". I've implemented this in the sandbox, so the test cases in the above thread also testcase this. I implemented it as ', so that it does not accidentally trigger any parsing problems, e.g. when used with a value that leads or ends with the same character, which would put two in a row and turn on italicization accidentally. The only downside I can think of is that in a few cases where people have included single quotes around a value manually (e.g. as {{lang-es|mi casa es su casa|lit='my house is your house'}} that it will produce output like: Spanish
: [mi casa es su casa] Error: {{Lang}}: text has italic markup (help), lit. ''my house is your house''. But this is not a big problem. It just looks like double quotes (which many cases already incorrectly have), and it's not any more incorrect that the majority use (no quotes at all) that we're stuck with in the vast majority of cases. A bot can fix it; just look for any string in this template, occurring after |[optional whitespace]lit[optional whitespace]=[optional whitespace] that both begins and ends with a ' (or, while we're at it, any other quotation-character pairs). I could probably cobble up the regular expression to do this myself. — SMcCandlish ☺☏¢ ≽ʌⱷ҅ᴥⱷʌ≼ 21:29, 13 April 2016 (UTC)[reply]
You know I’m pretty fond of you and your work, but this doesn’t look quite right to me; apologies if I got the order of operations wrong, but I brought it up on MOS talk instead of here. Thank you, again. —LLarson (said & done) 16:48, 14 April 2016 (UTC)[reply]
Overhauling the lang-xx templates for more selective italics behavior
In the documentation (for example, near the bottom of Template:Lang-la), the label parameter description says, "If 'none', suppresses language link and label". However, it also seems to suppress the 'lit.' which is normally generated by the lit parameter, and not just the language label. Is this intended, and if so, should it be changed so that there is a separate control for the lit label?
Compare setting label=none using Template:Lang-la:
{{lang-la|salve|lit=hello}}
{{lang-la|salve|lit=hello|label=none}}
The implementation of label=none and labels=no, respectively, is different. Even though Template:Korean uses Template:Lang, the plaintext lit label remains even when the labels parameter is off. I'm not sure which one is better for usability and complexity, but I do wonder about it. ChromeGames923 (talk) 02:52, 4 March 2020 (UTC)[reply]
Edit request 2021
Why the colon? - The matter has been raised by Macrakis since 2014, but nobody cared, apparently.
I propose to add an optional parameter to suppress the colon, in order to make the text sound more natural in sentences like:
The surname 'Example' comes from the Latin domus, lit. 'home', following example sentence about the surname.
this word, from the French carton, has now...
Instead of the present code:
The surname 'Example' comes from Latin: domus, lit. 'home', following example sentence about the surname.
Thanks for coming back to this. Suppressing the colon would certainly be useful in continuous text, as you mention. But I think the colon is also superfluous in other contexts. I am pretty sure that standard reference works do not use colons in this way, but I'll have to wait for the libraries to reopen to leaf through a few.... --Macrakis (talk) 17:15, 11 February 2021 (UTC)[reply]
2014, when I was involved here, is long ago (remember, those times before corona!). Also I'm not this good in English grammar/sentencing/spelling. So I give it a pass if you don't mind. (I will add TemplateData to have WP:TPU active in March). -DePiep (talk) 18:10, 11 February 2021 (UTC)[reply]
Template-protected edit request on 13 January 2022
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
To inherit italic property of first argument text from templates like "Template:Lang-rus" to this template and from this template to the template Template:Lang and then pass to Module:Lang, please add this argument "italic={{{italic|unset}}}" i.e., change
that has an additional argument i.e. "italic={{{italic|unset}}}". You can test this functionality in Template:Language with name/sandbox and Template:Language with name/testcases.
I.e., "{{Lang-rus/sandbox |déjà vu| lit=already seen|italic=no}}" results in "Russian: déjà vu" that is not italic. And "{{Lang-rus/sandbox |déjà vu| lit=already seen|italic=yes}}" results in "Russian: déjà vu" that is italic. But the output of {{Lang-rus|déjà vu|lit=already seen|italic=no}} is Russian: déjà vu that is incorrectly still italic. So by this small modification i.e., "adding argument italic={{{italic|unset}}}" italic property is inherited.
Is this an appropriate place to discuss which language templates should exist? It is rare, but I would like to be able to tag words or phrases from Moriori. If appropriate, I can happily clone another template at {{Lang-rrm}}, using the proposed ISO 639-3 code listed at its article. — HTGS (talk)21:47, 31 March 2022 (UTC)[reply]
Probably not. Templates should be named for what they do, and we would end up with a confusing mix of template purposes. See {{French}}, {{Spanish}}, {{Japanese}}, and others that already exist and point to a variety of template types. I would prefer that those templates did not exist either, or were template disambiguation pages. – Jonesey95 (talk) 19:26, 15 October 2022 (UTC)[reply]
It would probably be better if they had a unified use. The documentation could easily cover the alternatives. I have always thought that relying on people to remember ISO codes was a shortcoming, and indeed, some of my solutions support (or at least supported) English names for languages and countries as well as ISO codes. I think this is a too valuable part of namespace to discard as "too difficult". All the best: RichFarmbrough13:46, 12 July 2025 (UTC).[reply]
Template-protected edit request on 9 November 2024
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
I suggest we add a notice on this page to warn users against creating more lang-xx templates using this as per the TfD. It could be worded as such:
"Lang-xx" templates are not to be created using this template anymore. Lang-xx templates have been deprecated as per this discussion. Instead, editors are encouraged to use Template:langx.