Template:Int/doc: Difference between revisions
More actions
←Created page with '{{TemplateBox |name = Int |desc = This is a wrapper for searching MediaWiki translations in MediaWiki:*/lang, to be used instead of <nowiki>{{int:Name/lang}...' |
Use main {{TemplateBox}} |
||
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | |||
{{TemplateBox | {{TemplateBox | ||
| name = int | |||
| mbox = | |||
{{tsh|localized mw message}} | |||
{{Lua|Module:Int}} | |||
| desc-en = | |||
Shows a MediaWiki message in the same language of the page (identified by the subpage name) within a translated page, or the language specified using the {{para|lang}} parameter; if the resource in the specified language does not exist (translation missing), it will look for a single fallback in English or with the default UI language. Otherwise it will return a default string. | |||
Not to be confused with {{magic word|code=1|nowrap=1|int|XXX}}, which always shows the message in the language chosen by the user in their [[Special:Preferences#mw-prefsection-personal|preferences]]. | |||
| namespace = all | |||
| usergroup = all | |||
| relieson = | |||
* [[Module:Int]] | |||
* {{magic word|mono=1|nowrap=1|int|*/lang}} builtin parser function | |||
* pages in "Mediawiki:*/lang" for messages translated and imported from Translatewiki.net (some resources are located in MediaWiki itself in PHP plugins, and don't need to be imported) | |||
* Mediawiki:*/lang | |||
| i18n-method = - | |||
| i18n-desc = | |||
| print = line | |||
| useTemplateData = TNT | |||
| 1 = lang | |||
| 2 = 1 | |||
}} | }} | ||
<includeonly>{{Sandbox other|| | |||
<!-- Categories below this line; interwikis at Wikidata --> | |||
[[Category:Navigational templates for the translate extension|* {{PAGENAME}}]] | |||
}}</includeonly> | |||
Latest revision as of 20:42, 24 November 2024
Shows a MediaWiki message in the same language of the page (identified by the subpage name) within a translated page, or the language specified using the |lang= parameter; if the resource in the specified language does not exist (translation missing), it will look for a single fallback in English or with the default UI language. Otherwise it will return a default string.
Not to be confused with {{int:XXX}}, which always shows the message in the language chosen by the user in their preferences.
Usage
{{int |lang= |1= }}
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
Renders a MediaWiki interface message in the page language.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Language | lang | The language to show the message in. Note that {{TRANSLATIONLANGUAGE}} is only valid inside translate tags.
| String | suggested |
| Interface message name | 1 | The name of the MediaWiki interface message (without the “MediaWiki:” namespace prefix). | String | required |
| Missing value default | missing | The value to return when the MediaWiki interface message does not exist.
| Content | suggested |
| Replacement 1 | 2 | The replacement string for “$1”. | Content | optional |
| Replacement 2 | 3 | The replacement string for “$2”. | Content | optional |
| Replacement 3 | 4 | The replacement string for “$3”. | Content | optional |
| Replacement 4 | 5 | The replacement string for “$4”. | Content | optional |
| Replacement 5 | 6 | The replacement string for “$5”. | Content | optional |
| Replacement 6 | 7 | The replacement string for “$6”. | Content | optional |
| Replacement 7 | 8 | The replacement string for “$7”. | Content | optional |
| Replacement 8 | 9 | The replacement string for “$8”. | Content | optional |
| Replacement 9 | 10 | The replacement string for “$9”. | Content | optional |
Edit parameter translations
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
- Module:Int
- {{int:*/lang}} builtin parser function
- pages in "Mediawiki:*/lang" for messages translated and imported from Translatewiki.net (some resources are located in MediaWiki itself in PHP plugins, and don't need to be imported)
Localization
This template is not intended to be localized.