Template:Translatable template/doc: Difference between revisions

From Vintage Story Wiki
m
no edit summary
(nom. for del)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{d|Obsolete due to MW 1.38 update}}{{lua|Template translation}}
{{Delete|Obsolete due to MW 1.38 update}}{{lua|Template translation}}


== Purpose ==
== Purpose ==
Line 5: Line 5:


== How to use ==
== How to use ==
* {{tlx|Translatable template|''name of template''|''parameters....''}}
* {{tl|Translatable template|''name of template''|''parameters....''}}
* {{tlx|TNT|''name of template''|''parameters....''}}
* {{tl|tnt|''name of template''|''parameters....''}}
* {{tlx|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:


{{tlx|Translatable template|Extension-Translate}} or {{tlx|TNT|Extension-Translate}}
{{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:
* {{tlx|Translatable template|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}}
* {{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:
* {{tlx|Translatable template|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}}
* {{tl|Translatable template|template{{=}}''name of template''|noshift{{=}}1|1{{=}}''first parameter of called template''|...}}
* {{tlx|TNT|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''|...}}
* {{tlx|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:
* {{tlx|TNT|Special global permissions/Seealso|Global sysops}}
* {{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".


Confirmedusers
1,783

edits