Template:Translatable template name
This template is used to return the name of translatable templates in the language of the current page. Templates, like all other MediaWiki pages, can be translated using the Translate extension, which creates subpages with the form “pagename/language code”. The template first checks if the name of the current page contains a language code. If it does, it then checks if the template name given as a first parameter has a translation in that language. If the page name does not contain a language code, or if the navigation template doesn’t exist in that language, it will display the English template.
Usage
{{Translatable template name |1= }}
{{ {{Translatable template name|name of navigation template}}|parameters....}}
{{ {{TNTN|name of navigation template}}|parameters....}}
{{ {{tntn|name of navigation template}}|parameters....}}
Example (from translatable Template:Meta, used in translatable page Meta:About):
{{Translatable template name|Tnavbar}}
or{{TNTN|Tnavbar}}
which returns the translated versions of {{Tnavbar}} if it exists, or the English version if translations don't exist.
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1
or useTemplateData=only
on the /doc
subpage and transcluding it with {{Documentation}} into the template. <nowiki>
-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>
-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
This template is used to return the name of translatable templates in the language of the current page. Templates, like all other MediaWiki pages, can be translated using the Translate extension, which creates subpages with the form “pagename/language code”. The template first checks if the name of the current page contains a language code. If it does, it then checks if the template name given as a first parameter has a translation in that language. If the page name does not contain a language code, or if the navigation template doesn’t exist in that language, it will display the English template.
Parameter | Description | Type | Status | |
---|---|---|---|---|
template name | 1 | The name of the template to get translations for. Required unless “noshift” parameter is used, in which case it’s ignored. | Template | suggested |
namespace | namespace | Namespace to get translations for.
| Line | optional |
no shift | noshift | Use “template” parameter for template name instead of unnamed parameter 1. It’s used in {{TNT}} to avoid shifting all unnamed parameters, and included here for the sake of consistency. It doesn’t make much sense in this template, though. | Line | deprecated |
template name (no shift) | template | The name of the template to get translations for. Required if “noshift” parameter is used, otherwise ignored. | Template | deprecated |
desired language | uselang | The language the template should be translated into, by default the language of the current page. If this template doesn’t exist, the template falls back to use English. | Line | optional |
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
Relies on:
- Module:Template translation (standard version)
- Module:Template translation/sandbox (used when this template is called with optional parameter
sandbox=/sandbox
, for testing modifications only)
See also
- {{Translatable template}}, alias {{TNT}} or {{Tnt}}
- {{Multilingual link}} – choose link to Wikipedia article in the user interface language
Localization
This template is not intended to be localized.