Confirmedusers
1,783
edits
(nom. for del) |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{Delete|Obsolete due to MW 1.38 update}}{{lua|Template translation}} | ||
== Purpose == | == Purpose == | ||
Line 5: | Line 5: | ||
== How to use == | == How to use == | ||
* {{ | * {{tl|Translatable template|''name of template''|''parameters....''}} | ||
* {{ | * {{tl|tnt|''name of template''|''parameters....''}} | ||
The above simplified syntax cannot work if the named template also needs to be transcluded in other translatable templates, because it would cause self-recursion of {{tl|Translatable template}}. An alternative is to use {{tl|Translatable template name}} which does not expand the template with its parameters, but only returns the resolved template name, which can then be | The above simplified syntax cannot work if the named template also needs to be transcluded in other translatable templates, because it would cause self-recursion of {{tl|Translatable template}}. An alternative is to use {{tl|Translatable template name}} which does not expand the template with its parameters, but only returns the resolved template name, which can then be | ||
Line 17: | Line 16: | ||
Example: | Example: | ||
{{ | {{tl|Translatable template|Extension-Translate}} or {{tl|tnt|Extension-Translate}} | ||
which includes translated versions of {{tl|Extension-Translate}} if it exists, or the English version if translations don't exist. | which includes translated versions of {{tl|Extension-Translate}} if it exists, or the English version if translations don't exist. | ||
Line 24: | Line 23: | ||
When that's problematic, you can use the special <code>template</code> and <code>noshift</code> parameters: | When that's problematic, you can use the special <code>template</code> and <code>noshift</code> parameters: | ||
* {{ | * {{tl|Translatable template|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}} | ||
One named parameter is treated specially: | One named parameter is treated specially: | ||
* {{ | * {{tl|Translatable template|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}} | ||
* {{ | * {{tl|tnt|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}} | ||
This <code>tntns</code> will be used to specify another namespace from which the translatable pagename will be transcluded, instead of referencing the page name from the default <code>:Template:</code> namespace. Note that this parameter is also passed (without modification) within the parameters of the transclusion. | This <code>tntns</code> will be used to specify another namespace from which the translatable pagename will be transcluded, instead of referencing the page name from the default <code>:Template:</code> namespace. Note that this parameter is also passed (without modification) within the parameters of the transclusion. | ||
Example with one parameters: | Example with one parameters: | ||
* {{ | * {{tl|tnt|Special global permissions/Seealso|Global sysops}} | ||
where the second parameter "Global sysops" is the value of the first numbered parameter transferred into called page "Special global permissions/Seealso". | where the second parameter "Global sysops" is the value of the first numbered parameter transferred into called page "Special global permissions/Seealso". | ||