Jump to content

From Noumenapedia

Template:Langx/doc

__EXPECTED_UNCONNECTED_PAGE__

This language template identifies non-English text. It is very similar to {{lang}} but inserts the name of the language as a label. The text is formatted according to recommendations in Wikipedia:Manual of Style/Text formatting § Foreign terms: italics for languages that use the Latin alphabet, normal for others.

Usage

An IETF language tag and the non-English term or phrase are the only required parameters.

The template should generally be placed after the English translation of the foreign term or phrase.

  • The parameter <syntaxhighlight lang="wikitext" inline style="display: none;" />|links=no prevents the language name from being linked.
  • The parameter <syntaxhighlight lang="wikitext" inline style="display: none;" />|translit= allows for a romanization. This parameter is not supported by {{langx|<tag>|...}} templates for languages that are already written in Latin script.
  • The parameter <syntaxhighlight lang="wikitext" inline style="display: none;" />|lit= enables a literal translation (in English) to be given.

Parameters

Langx supported parameters
Parameter Definition Yields to Alias
<syntaxhighlight lang="wikitext" inline style="display: none;" />|1= The IETF language tag for the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text= — <syntaxhighlight lang="wikitext" inline style="display: none;" />|code=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|text= The non-English text — <syntaxhighlight lang="wikitext" inline style="display: none;" />|2=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|translit= The Latin script transliteration of the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text= — <syntaxhighlight lang="wikitext" inline style="display: none;" />|3=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|translit-std= The standard used for the transliteration of the value of <syntaxhighlight lang="wikitext" inline style="display: none;" />|translit=; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|translit-script= The transliteration standard's script identifier —
<syntaxhighlight lang="wikitext" inline style="display: none;" />|translation= The literal English translation or gloss of the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text=. Will be surrounded in single-quotes. The text will be tagged with CSS class <syntaxhighlight lang="text" class="" style="" inline="1">gloss-text</syntaxhighlight> and the quotes with <syntaxhighlight lang="text" class="" style="" inline="1">gloss-quot</syntaxhighlight>, like how {{gloss}} does it, enabling customization in user stylesheets. — <syntaxhighlight lang="wikitext" inline style="display: none;" />|lit=, <syntaxhighlight lang="wikitext" inline style="display: none;" />|4=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|label= The label to be used instead of template-provided language label. May be wikilinked. Special keyword
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ causes the template to render without any labels (including transliteration and translation labels) || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|link= Links language name and static text associated with <syntaxhighlight lang="wikitext" inline style="display: none;" />|translit= and <syntaxhighlight lang="wikitext" inline style="display: none;" />|translation=. Defaults to
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__. Accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__; <syntaxhighlight lang="wikitext" inline style="display: none;" />|link=no does not unlink wikilinked labels set by <syntaxhighlight lang="wikitext" inline style="display: none;" />|label= || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — || <syntaxhighlight lang="wikitext" inline style="display: none;" />|links=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|proto= Accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (default) or
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (default for private-use language tags with the
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ subtags); when
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (default or explicit), prefixes rendered text with an asterisk indicating 'unattested' || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
|script= (Deprecated – include script subtag in <syntaxhighlight lang="wikitext" inline style="display: none;" />|1=) IETF language script subtag; sometimes set by the template when the language of the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text= uses more than one writing system; always four alpha characters; a value of
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (not "Latin"!) forces italic rendering unless overridden by <syntaxhighlight lang="wikitext" inline style="display: none;" />|italic=; overrides <syntaxhighlight lang="wikitext" inline style="display: none;" />|rtl= || <syntaxhighlight lang="wikitext" inline style="display: none;" />|italic= ||
|region= (Deprecated – include region subtag in <syntaxhighlight lang="wikitext" inline style="display: none;" />|1=) IETF language region subtag —
|variant= (Deprecated – include variant subtag in <syntaxhighlight lang="wikitext" inline style="display: none;" />|1=) IETF language variant subtag —
<syntaxhighlight lang="wikitext" inline style="display: none;" />|rtl=
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ indicates that the writing system used for the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text= is right-to-left; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (default),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ || <syntaxhighlight lang="wikitext" inline style="display: none;" />|script= ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|italic= see table "Langx <syntaxhighlight lang="wikitext" inline style="display: none;" />|italic= parameter operation"; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — || <syntaxhighlight lang="wikitext" inline style="display: none;" />|italics=, <syntaxhighlight lang="wikitext" inline style="display: none;" />|i=
<syntaxhighlight lang="wikitext" inline style="display: none;" />|size= Specifies font size of the content in <syntaxhighlight lang="wikitext" inline style="display: none;" />|text=; use a value suitable for use with the CSS font-size property; this should almost always be a relative value supplied in
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ or
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ units, not a fixed
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ value. || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|engvar= Selects English variant spelling of 'romanised' or 'romanized' (default) according to the country specified; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (Australia),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (Canada),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (Great Britain),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (Ireland),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (India),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (New Zealand),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (United States),
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ (South Africa) || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|cat= Inhibits automatic categorization; mirror version of <syntaxhighlight lang="wikitext" inline style="display: none;" />|nocat=; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
<syntaxhighlight lang="wikitext" inline style="display: none;" />|nocat= Inhibits automatic categorization; mirror version of <syntaxhighlight lang="wikitext" inline style="display: none;" />|cat=; accepted values are:
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__,
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ || data-sort-value="" style="vertical-align:middle; text-align:center" class="table-na" | — ||
Langx <syntaxhighlight lang="wikitext" inline style="display: none;" />|italic= parameter operation
<syntaxhighlight lang="wikitext" inline style="display: none;" />|italic= value Description Example code Result HTML markup
  • parameter not present;
  • parameter present, not set;
  • invalid value
  • module applies style from:
  •   template setting, or
  •   
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ script subtag;
  • else inherits from external markup;
  • invalid values treated as default
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
Incorrect markup; this requires script subtag
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__.
<syntaxhighlight lang="wikitext" inline="1">French: toundra</syntaxhighlight> French: toundra <syntaxhighlight lang="wikitext" class="" style="" inline="1">French: toundra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">French: toundra</syntaxhighlight> French: toundra <syntaxhighlight lang="wikitext" class="" style="" inline="1">French: toundra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__
  • module applies upright style;
  • overrides
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ script subtag;
  • overrides external markup
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">French: toundra</syntaxhighlight> French: toundra <syntaxhighlight lang="wikitext" class="" style="" inline="1">French: toundra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__
  • module applies italic style;
  • ignores
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ script subtag
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__
  • module applies no style;
  • inherits style from external markup;
  • overrides
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ script subtag
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__
  • module applies no style;
  • inverts style in internal markup;[a]
  • disables auto-italics;
  • overrides
  1. REDIRECT Template:Parameter value
__EXPECTSHORTPAGE__ script subtag
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> Russian: тундра <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: тундра</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>
<syntaxhighlight lang="wikitext" inline="1">Russian: tûndra</syntaxhighlight> Russian: tûndra <syntaxhighlight lang="wikitext" class="" style="" inline="1">Russian: tûndra</syntaxhighlight>

Notes

  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named invertunset
Cite error: <ref> tag with name "invertunset" defined in <references> group "lower-alpha" has no content.

TemplateData

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

TemplateData for Langx

<templatedata> { "params": { "1": { "label": "Language tag", "description": "A valid IETF language tag identifying the language of the non-English text. E.g. \"ja\" for Japanese.", "type": "string", "required": true, "example": "ja" }, "2": { "label": "Text", "description": "The non-English text to display. E.g. \"東京都\" means \"Tokyo\" in Japanese.", "type": "string", "required": true, "example": "東京都" }, "3": { "label": "Transliteration", "description": "The transliteration of the foreign text, for languages that do not use the Latin alphabet. This field is ignored for languages that do use the Latin alphabet. E.g. \"Tōkyō\" is the standardized romanization of \"Tokyo\".", "type": "string", "aliases": [ "translit" ], "example": "Tōkyō" }, "4": { "label": "Literal translation", "description": "The literal translation of the foreign text. E.g. \"Tokyo\" means \"eastern capital\".", "type": "string", "aliases": [ "lit", "translation" ], "example": "eastern capital" }, "links": { "label": "Display link", "description": "Set to 'no' to disable the link to the article's language.", "type": "boolean", "aliases": [ "link" ], "default": "yes", "autovalue": "no" }, "label": { "label": "Language label", "description": "If 'none', suppresses language link and label. Other options may be available depending on the language.", "example": "none", "type": "line" }, "rtl": { "label": "Right-to-left", "description": "Toggle right-to-left view for the foreign text.", "type": "boolean", "example": "yes", "default": "no" }, "italic": { "label": "Italicize", "description": "Toggle italicization for the foreign text.", "type": "boolean", "default": "yes", "example": "no", "aliases": [ "italics", "i" ] }, "size": { "label": "Font-size", "description": "Sets font-size for the foreign text.", "example": "120%, 1.2em" }, "engvar": { "label": "English variant", "description": "Spelling of 'romanized/romanised'.", "type": "string", "suggestedvalues": [ "au", "ca", "gb", "ie", "in", "nz", "us", "za" ] } }, "description": "Indicates to readers the original form of a term or phrase in a foreign language.", "paramOrder": [ "1", "2", "3", "4", "links", "label", "rtl", "italic", "size", "engvar" ] } </templatedata>

Examples

The following examples show translations from German or French.

  • <syntaxhighlight lang="wikitext">Weimar is located in the federal state of Thuringia ({{Langx|de|Thüringen}}).</syntaxhighlight>Weimar is located in the federal state of Thuringia (German: Thüringen).
  • <syntaxhighlight lang="wikitext">The Seafarers of Catan ({{Langx|de|Die Seefahrer von Catan}}) is an expansion of the board game The Settlers of Catan.</syntaxhighlight>The Seafarers of Catan (German: Die Seefahrer von Catan) is an expansion of the board game The Settlers of Catan.
  • <syntaxhighlight lang="wikitext">Albert the Bear ({{Langx|de|Albrecht der Bär|links=no}})</syntaxhighlight>Albert the Bear (German: Albrecht der Bär)
  • <syntaxhighlight lang="wikitext">All Quiet on the Western Front ({{Langx|de|Im Westen nichts Neues|lit=In the West Nothing New}}) is a novel by Erich Maria Remarque.</syntaxhighlight>All Quiet on the Western Front (German: Im Westen nichts Neues, lit. 'In the West Nothing New') is a novel by Erich Maria Remarque.
  • <syntaxhighlight lang="wikitext">Paris Cité University ({{langx|fr|links=no|Université Paris Cité}}) is a public research university</syntaxhighlight>Paris Cité University (French: Université Paris Cité) is a public research university

Comparison with the Lang template

This template differs from the {{lang}} template in that this one labels the text with the name of the language. For that reason, to avoid unnecessary clutter, this template should be used sparingly, in cases where the name of the language should be made explicit, such as the first place in an article that the translation of a word or phrase in English is given, or when renderings in multiple languages are being given and confusion is possible in the absence of such labeling.

Comparison:

  • <syntaxhighlight lang="wikitext" inline="1">тундра</syntaxhighlight> produces тундра
  • <syntaxhighlight lang="wikitext" inline="1">Russian: тундра</syntaxhighlight> produces Russian: тундра
  • <syntaxhighlight lang="wikitext" inline="1">тундра</syntaxhighlight> produces тундра

Tracking categories

TODO: (2024-09-22) rename these categories

See also