Difference between revisions of "Template:Translation switching"

From Team Fortress Wiki
Jump to: navigation, search
m (works with template-sandbox, but does not work with the template -_-)
 
(9 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
   | 2 = This template uses [[Help:Translation switching|translation switching]]. The correct language will be displayed automatically.
 
   | 2 = This template uses [[Help:Translation switching|translation switching]]. The correct language will be displayed automatically.
 
   | 3style = font-size: 90%;
 
   | 3style = font-size: 90%;
   | 3 = Localized versions of this template (e.g. ''Template:{{BASEPAGENAME}}/ru'') are not necessary. Add your translations directly to this template by [{{fullurl:Template:{{BASEPAGENAME}}|action=edit}} editing it].<br />'''Supported languages for this template''': {{{1|none}}}&nbsp;([{{fullurl:Template:{{BASEPAGENAME}}|action=edit}} add])
+
   | 3 = Localized versions of this template (e.g. ''{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}/ru'') are not necessary. Add your translations directly to this template by [{{fullurl:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}|action=edit}} editing it].{{#if:{{{2|}}}{{{note|}}}
 +
  | <br />'''Note''': {{{2|{{{note}}}}}}
 +
  }}<br />'''Supported languages for this template''': {{{1|none}}}&nbsp;([{{fullurl:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}|action=edit}} add])
 
   }}
 
   }}
 
}}<includeonly>[[Category:Templates that use translation switching|{{PAGENAME}}]]<!--  
 
}}<includeonly>[[Category:Templates that use translation switching|{{PAGENAME}}]]<!--  
Line 12: Line 14:
 
| {{#switch:{{lc:{{{1|}}}}}
 
| {{#switch:{{lc:{{{1|}}}}}
 
  | blank
 
  | blank
| none
 
 
  | en
 
  | en
 
  | n/a
 
  | n/a
  | none = [[Category:Templates requiring translation|{{PAGENAME}}]]
+
  | none = {{#ifeq:{{NAMESPACE}}|Template|[[Category:Templates requiring translation|{{PAGENAME}}]]}}
 
  | #default = <!-- NULL -->
 
  | #default = <!-- NULL -->
 
  }}
 
  }}
 
| [[Category:Templates requiring translation|{{PAGENAME}}]]
 
| [[Category:Templates requiring translation|{{PAGENAME}}]]
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 +
{{doc begin}}
 +
This template is used to mark the pages of other templates that use '''[[Help:Translation switching|translation switching]]'''. Pages are automatically placed into the category [[:Category:Templates that use translation switching|Templates that use translation switching]] to find them later with ease.
  
* Place {{tl|translation switching}} or {{tl|ts}} on template documentation pages that use {{tl|lang}} to [[Help:Language translation|switch translations]] based on the language subpagename.  
+
=== Usage ===
* Display the languages supported by the template by using this code: {{tlx|translation switching|de, fr, ja, pl}}
+
Place {{tl|translation switching}} (or {{tl|ts}}) inside the {{code|&lt;noinclude>}} tags and above the documentation template (either {{tl|doc begin}} or {{tl|template doc}}).
* It will categorize them into [[:Category:Templates that use translation switching]].
+
 
* If no languages are defined, this template will categorize the page into [[:Category:Templates requiring translation]].
+
* Add the languages supported by the template as part of the first parameter: e.g. {{tlx|translation switching|ar, cs, fr, it, pt, ru}}
 +
* If no languages are added, the template will display "none" and categorize the page into [[:Category:Templates requiring translation]].  
 +
* Notes can be added also: {{tlx|translation switching|ar, cs, fr, it, pt, ru|Only one line requires translation.}}
 +
 
 +
=== See also ===
 +
* [[Help:Translation switching]]
 +
* [[Help:Language translation]]
  
 
[[Category:Language templates|Translation switching]]
 
[[Category:Language templates|Translation switching]]
 
[[Category:Maintenance templates|Translation switching]]
 
[[Category:Maintenance templates|Translation switching]]
 
</noinclude>
 
</noinclude>

Latest revision as of 08:34, 27 September 2015

Documentation for Translation switching

This template is used to mark the pages of other templates that use translation switching. Pages are automatically placed into the category Templates that use translation switching to find them later with ease.

Usage

Place {{translation switching}} (or {{ts}}) inside the <noinclude> tags and above the documentation template (either {{doc begin}} or {{template doc}}).

See also