| This template uses Lua: |
This template, {{Language with name/for}} (or its alias {{Langnf}}), provides a parenthetical translation into English for non-English text, prefixed with the name of the source language (optionally) linked to the article for that language.
Usage
Parameters
{{Language with name/for|<language tag>|<non-English text>|<English equivalent>}}
(Any empty parameters will cause an error, except for the first one when |lang-name= is defined.)
This template requires three unnamed/positional (or numbered as |1=, |2= and |3=) parameters…
- the ISO 639 or IETF language tag of the
<non-English text>(the second parameter, or|2=); see § Absent language tag below. <non-English text>– {{Lang}} will apply proper HTML markup for this text using the language tag specified in the first parameter (|1=).- the English equivalent of
<non-English text>; do not include quotation marks, those are automatically provided by the template.
…and accepts many more named parameters.
|term1=– an alias for the third parameter (<English equivalent>).|term2=..|termN=– additional 'or'-like translations, each wrapped in single quotes and separated by a spaced solidus (/).|lang-name=<label>– display<label>for cases where no ISO 639 language tag exists and the first parameter (<language tag>) is empty (see § Absent language tag).|italic-term=yes– italicize the third parameter (<English equivalent>) and any|term#=parameters; useful for multi-term translations which all require italics.|break=yes– insert a line break (HTML<br />tag) between the language name and the non-English text.|paren=none/left:- If
none, omit both parentheses that would enclose<language name> for <English equivalent>. - If
left, output only the opening parenthesis that precedes<language name> for <English equivalent>and omit the closing one that should follow it; allows the translation to be modified by what comes after it, relying on the editor to supply the missing punctuation needed to complete the parenthetical.
- If
This template also accepts all parameters supported by {{Lang}}, except for |code= and |text=.
Examples
Basic use:
{{Language with name/for|es|Casa|house}}- Casa (Spanish for 'house')
Using |lang-name=Massachusett:
{{Language with name/for||kuncannowet|breast}}– note the empty first parameter- kuncannowet (Massachusett for 'breast')
Using |break=yes:
{{Language with name/for|es|Casa|house|break=yes}}- Casa
(Spanish for 'house')
- Casa
Using |paren=none:
{{Language with name/for|es|Casa|house|paren=none}}- Casa Spanish for 'house'
Using |paren=left:
{{Language with name/for|fr|'''L'Aurore'''|The Dawn|paren=left}}; {{IPA|fr|loʁɔʁ|IPA}})
Using |term1=house, |term2=hut, |term3=mansion and |italic-term=yes:
{{Language with name/for|es|Casa|term1=house|term2=hut|term3=mansion|italic-term=yes}}- Casa (Spanish for 'house' / 'hut' / 'mansion')
Absent language tag
When there is an ISO 639 language tag for the non-English text's language, always use that tag; do not use |lang-name=. Only in cases where there is no valid ISO 639 language tag for the non-English text should you use |lang-name= to supply the displayed language name. This template applies proper HTML markup to the non-English text when given a proper language tag, but when the language name is provided by |lang-name=, it resorts to setting the HTML lang="mis" attribute—indicating an uncoded language—which offers no useful information to the reader or Wikipedia's infrastructure (a suboptimal result).
Whenever possible, do this…
{{Language with name/for|es|Casa|house}}- Casa (Spanish for 'house')
<span title="Spanish-language text"><i lang="es">Casa</i></span> ([[Spanish language|Spanish]] for 'house')
- Casa (Spanish for 'house')
…instead of this
{{Language with name/for||Casa|house|lang-name=Spanish}}- Casa (Spanish for 'house')
<span title="uncoded-language text"><i lang="mis">Casa</i></span> ([[Spanish language|Spanish]] for 'house')
- Casa (Spanish for 'house')
TemplateData
TemplateData for Language with name
Provides a parenthetical translation into English for non-English text
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Language code | 1 | An ISO 639 or IETF language tag representing the language of the non-English text
| Line | required |
| Source text | 2 | The non-English text to be translated; wiki markup is permitted.
| String | required |
| English translation | 3 term1 | English text representing the equivalent of the source text; do not wrap with quotation marks.
| String | required |
| Source language label | lang-name | If there is not an appropriate ISO 639 or IETF language tag for the source text, supply an appropriate language label here, may be wikilinked
| Line | optional |
| Italicize translations | italic-term | Show all supplied English translations (the third parameter and any named term#) in italic text
| Boolean | optional |
| Line break after label | break | Insert a line break after the label identifying the source language, causing the non-English text to be repositioned beneath the language label instead of to the right of it
| Boolean | optional |
| Omit parentheses | paren | Omit both parentheses (when set to 'none') that wrap the English translation(s) and the 'in English' identifier, or only the right one (when set to 'left')
| Line | optional |
| Alternate translation 1 | term2 | Another English equivalent for the source text, shown quoted like the first and separated by a spaced solidus (slash)
| String | optional |
| Alternate translation 2 | term3 | Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)
| String | optional |
| Alternate translation 3 | term4 | Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)
| String | optional |
| Alternate translation 4 | term5 | Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)
| String | optional |
Errors
This template detects errors and adds articles that have them to Category:Language with name/for errors (0) while emitting one or more of the following messages to editors of those pages:
- missing language tag or language name – this template requires either a valid ISO 630 or IETF language tag as the first unnamed/positional parameter (
{{{1}}}or|1=) or that the|lang-name=parameter is defined. To resolve this error, provide an appropriate language tag as the first parameter or verify that the existing one is valid, otherwise define|lang-name=with an appropriate language name as its value; see § Parameters and § Absent language tag for the specific requirements. - #d33 – since
|lang-name=overrides any value of the first parameter ({{{1}}}), only one of these is allowed; keep the most appropriate one and remove the other. See § Absent language tag for more guidance. - missing English translation – an English-language translation of the non-English text is required, either as the value of the third unnamed/positional parameter (
{{{3}}}),|3=or|term1=.