Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Translatable template/doc: Difference between revisions

Template page
No edit summary
fix <code> tags
Line 5: Line 5:


== How to use ==
== How to use ==
* <code><nowiki>{{Translatable template|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....''<nowiki>}}</nowiki></tt>
* <code><nowiki>{{Translatable template|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....''<nowiki>}}</nowiki></code>
* <code><nowiki>{{TNT|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{TNT|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></code>
* <code><nowiki>{{tnt|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{tnt|</nowiki>''name of template''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></code>


The above simplied 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 simplied 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
transcluded normally:
transcluded normally:
* <code><nowiki>{{{{Translatable template name|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....''<nowiki>}}</nowiki></tt>
* <code><nowiki>{{{{Translatable template name|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....''<nowiki>}}</nowiki></code>
* <code><nowiki>{{{{TNTN|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{{{TNTN|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></code>
* <code><nowiki>{{{{tntn|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{{{tntn|</nowiki>''name of template''<nowiki>}}|</nowiki>''parameters....<nowiki>}}</nowiki></code>


Example (from [[Meta:Administrator]]):
Example (from [[Meta:Administrator]]):
Line 24: Line 24:


One named parameter is treated specially:
One named parameter is treated specially:
* <code><nowiki>{{Translatable template|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....''<nowiki>}}</nowiki></tt>
* <code><nowiki>{{Translatable template|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....''<nowiki>}}</nowiki></code>
* <code><nowiki>{{TNT|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{TNT|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></code>
* <code><nowiki>{{tnt|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></tt>
* <code><nowiki>{{tnt|namespace=</nowiki>'':somename:''<nowiki>|</nowiki>''page name''<nowiki>|</nowiki>''parameters....<nowiki>}}</nowiki></code>
This <code>namespace</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>namespace</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.


Line 38: Line 38:
== See also ==
== See also ==
* {{tl|Translatable template name}}, alias {{tl|TNTN}} or {{tl|tntn}}
* {{tl|Translatable template name}}, alias {{tl|TNTN}} or {{tl|tntn}}
<includeonly>
<includeonly>
<!-- PUT HERE THE CATEGORIES OF THE TEMPLATE -->
<!-- PUT HERE THE CATEGORIES OF THE TEMPLATE -->
Cookies help us deliver our services. By using our services, you agree to our use of cookies.