• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Language with name/for

  • Template
  • Talk
  • Language
  • Watch
  • View source
< Template:Language with name
Template documentation[view] [edit] [history] [purge]
Shortcut
  • {{LangnfTemplate:Langnf}}
This template uses Lua:
  • Module:Language with name/for

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.

Contents

  • 1 Usage
    • 1.1 Parameters
    • 1.2 Examples
    • 1.3 Absent language tag
  • 2 TemplateData
  • 3 Errors
  • 4 See also

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…

  1. the ISO 639 or IETF language tag of the <non-English text> (the second parameter, or |2=); see § Absent language tag below.
  2. <non-English text> – {{Lang}} will apply proper HTML markup for this text using the language tag specified in the first parameter (|1=).
  3. 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.

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')

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}})
L'Aurore (French for 'The Dawn'; IPA: [loʁɔʁ])

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 &#39;house&#39;)

…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 &#39;house&#39;)

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Language with name in articles based on its TemplateData.

TemplateData for Language with name

Provides a parenthetical translation into English for non-English text

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Language code1

An ISO 639 or IETF language tag representing the language of the non-English text

Example
la
Linerequired
Source text2

The non-English text to be translated; wiki markup is permitted.

Example
Nolite vos spuriis commolendis.
Stringrequired
English translation3 term1

English text representing the equivalent of the source text; do not wrap with quotation marks.

Example
Don't let the bastards grind you down.
Stringrequired
Source language labellang-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

Example
Latin
Lineoptional
Italicize translationsitalic-term

Show all supplied English translations (the third parameter and any named term#) in italic text

Example
yes
Booleanoptional
Line break after labelbreak

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

Example
yes
Booleanoptional
Omit parenthesesparen

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')

Suggested values
none left
Lineoptional
Alternate translation 1term2

Another English equivalent for the source text, shown quoted like the first and separated by a spaced solidus (slash)

Example
Don't let those of illegitimate birth diminish your resolve.
Stringoptional
Alternate translation 2term3

Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)

Example
Don't let anyone born to an unknown father break your spirit.
Stringoptional
Alternate translation 3term4

Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)

Example
Don't let people of no worth affect you as though they had some.
Stringoptional
Alternate translation 4term5

Another English equivalent for the source text, shown quoted like the others and separated by a spaced solidus (slash)

Example
Don't let liars determine your truth.
Stringoptional

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=.

See also

  • {{Lang}}
  • {{Langx}}, the {{Lang}} template's complementary inverse
The above documentation is transcluded from Template:Language with name/for/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Language_with_name/for&oldid=1292568727"