Template:TranslateThis/doc: Difference between revisions

From Wikidata
Jump to navigation Jump to search
Content deleted Content added
Was a bee (talk | contribs)
{{Lua|Module:TranslateThis}}
add TemplateData documentation
Line 2: Line 2:
<!-- Categories go at the bottom of this page. -->
<!-- Categories go at the bottom of this page. -->
{{Lua|Module:TranslateThis}}
{{Lua|Module:TranslateThis}}

<templatedata>
{
"description": {
"en": "This template can be used to display multilingual text in user’s preferred language if available, and display a call for translation if not.",
"de": "Diese Vorlage kann benutzt werden, um mehrsprachige Text in der gewählten Sprache des Benutzers zu zeigen, wenn sie verfügbar ist, sonst Übersetzung anzufragen."
},
"params": {
"en": {
"label": {
"en": "English",
"de": "Englisch"
},
"description": {
"en": "The translatable text in English. Similarly “de” for German, “fr” for French, “es” for Spanish etc. Note that only the English text is required.",
"de": "Die übersetzbare Text auf Englisch. Änlich „de“ für Deutsch, „fr“ für Französisch, „es“ für Spanisch usw. Nur englische Text ist erforderlich."
},
"example": "English text",
"type": "line",
"required": true
},
"anchor": {
"label": {
"en": "anchor",
"de": "Anker"
},
"description": {
"en": "Language-independent anchor for the template output. Either an anchor text, or the code of a language present to use text in that language in the anchor (e.g. “en” to create anchor from the English text, even if the template is displayed in a different language).",
"de": "Sprachunabhängiger Anker für die Ausgabe der Vorlage. Entweder eine Ankertext, oder der Code einer gegebenen Sprache, um die Text dieser Sprache zu nutzen (z. B. „en“, um zu dem Anker die englische Text zu nutzen, auch wenn die Vorlage in einer anderen Sprache gezeigt wird)."
},
"type": "line"
},
"lang": {
"label": {
"en": "language",
"de": "Sprache"
},
"description": {
"en": "Language code to display the template in. This affects the chosen translation as well as the “please translate this” text. Useful in other templates and translated help pages to provide consistent output.",
"de": "Code der Sprache, in der die Text gezeigt werden soll. Wird benutzt auch fürs gewählte Übersetzung und die „bitte übersetze“-Text. Praktisch in anderen Vorlagen und auf Hilfeseiten, um konsistente Ausgabe zu produzieren."
},
"example": "en",
"type": "line"
}
}
}
</templatedata>


== Usage ==
== Usage ==
{{TranslateThis}}
{{TranslateThis}}

== Parameters ==
* '''anchor''': If this parameter is supplied, a language-independent [[Template:anchor|anchor]] is generated. You can either directly specify the anchor name, or supply a code of the language, whose text should be used as the anchor.


== See also ==
== See also ==
*{{tl|LangSwitch}} – displays text in user language similarly, but doesn’t include the call for translation if no perfectly matching translation found
*{{tl|LangSwitch}}
*{{tl|Anchor}} – used in this template to provide anchor

*{{tl|Help translate}} – used in this template to show the call for translation, please translate it there
<includeonly>
<includeonly>
<!-- Categories go here: -->
<!-- Categories go here: -->

Revision as of 18:26, 24 July 2019

This template can be used to display multilingual text in user’s preferred language if available, and display a call for translation if not.

Template parameters

ParameterDescriptionTypeStatus
Englishen

The translatable text in English. Similarly “de” for German, “fr” for French, “es” for Spanish etc. Note that only the English text is required.

Example
English text
Linerequired
anchoranchor

Language-independent anchor for the template output. Either an anchor text, or the code of a language present to use text in that language in the anchor (e.g. “en” to create anchor from the English text, even if the template is displayed in a different language).

Lineoptional
languagelang

Language code to display the template in. This affects the chosen translation as well as the “please translate this” text. Useful in other templates and translated help pages to provide consistent output.

Example
en
Lineoptional

Usage

See also

  • {{LangSwitch}} – displays text in user language similarly, but doesn’t include the call for translation if no perfectly matching translation found
  • {{Anchor}} – used in this template to provide anchor
  • {{Help translate}} – used in this template to show the call for translation, please translate it there