Template:Translatable navigation template/doc View history

m (1 revision: Copy from http://www.mediawiki.org/wiki/Template:Translatable_navigation_template)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>{{Documentation subpage}}
<noinclude>{{Documentation subpage}}</noinclude>
{{timw|{{BASEPAGENAME}}}}
 
</noinclude>
<!-- PUT HERE THE DOCUMENTATION -->
<!-- PUT HERE THE DOCUMENTATION -->
== Purpose ==
== Purpose ==
This template is used to show translatable static templates (templates without parameters) in the language of the current page. Templates, like all other MediaWiki pages, can be translated using the [[Extension:Translate|Translate extension]], which creates subpages with the form "pagename/language code". The template first checks if the name of the 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.
This template is used to show translatable static templates (templates without parameters) 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 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.


== How to use ==
== How to use ==
<code><nowiki>{{Translatable navigation template|</nowiki>''name of navigation template''<nowiki>}}</nowiki></code>
<code><nowiki>{{Translatable navigation template|</nowiki>''name of navigation template''<nowiki>}}</nowiki></code>


Example (from [[Help:Extension:Translate]]):
Example:


:<code><nowiki>{{Translatable navigation template|Extension-Translate}}</nowiki></code>
:<code><nowiki>{{Translatable navigation template|Extension-Translate}}</nowiki></code>
Line 16: Line 15:
or
or
:<code><nowiki>{{tnt|Extension-Translate}}</nowiki></code>
:<code><nowiki>{{tnt|Extension-Translate}}</nowiki></code>
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 if it exists, or the English version if translations don't exist.


== Limitations ==
== Limitations ==
Line 27: Line 26:


<includeonly>
<includeonly>
<!-- PUT HERE THE CATEGORIES OF THE TEMPLATE -->
<!-- PUT HERE THE CATEGORIES OF THE TEMPLATE -->
[[Category:Navigation templates|* {{PAGENAME}}]]
[[Category:Navigation templates|* {{PAGENAME}}]]
</includeonly>
</includeonly>

Latest revision as of 10:26, 14 April 2014

This is a documentation subpage for Template:Translatable navigation template.
It contains usage information, categories and other content that is not part of the original template page.

Purpose

This template is used to show translatable static templates (templates without parameters) 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 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.

How to use

{{Translatable navigation template|name of navigation template}}

Example:

{{Translatable navigation template|Extension-Translate}}

or

{{TNT|Extension-Translate}}

or

{{tnt|Extension-Translate}}

which includes translated versions of if it exists, or the English version if translations don't exist.

Limitations

This template only works with static templates, i.e. templates that do not have parameters. If needed it can be expanded to include unnamed parameters, but named parameters are not possible to do in an easy way at the moment.

For templates that have parameters, use Template:Translatable navigation template name.