This template is protected from editing.

Difference between revisions of "Template:Lang cat"

From Team Fortress Wiki
Jump to: navigation, search
m
m (fix)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#switch: {{{2}}}
+
{{#if:{{{1|}}}
| force = [[Category:{{{1}}}]]
+
| {{#switch:{{lc:{{{namespace-overrride|{{NAMESPACE}}}}}}}<!--
| #default= [[Category:{{{1}}}{{#switch: {{SUBPAGENAME}}
 
| af = /af
 
| ar = /ar
 
| az = /az
 
| bcc = /bcc
 
| bg = /bg
 
| br = /br
 
| ca = /ca
 
| cs = /cs
 
| da = /da
 
| de = /de
 
| el = /el
 
| es = /es
 
| fa = /fa
 
| fi = /fi
 
| fr = /fr
 
| gl = /gl
 
| gu = /gu
 
| he = /he
 
| hu = /hu
 
| id = /id
 
| it = /it
 
| ja = /ja
 
| ka = /ka
 
| ko = /ko
 
| ksh = /ksh
 
| kw = /kw
 
| mk = /mk
 
| ml = /ml
 
| mr = /mr
 
| ms = /ms
 
| nl = /nl
 
| no = /no
 
| oc = /oc
 
| pl = /pl
 
| pt = /pt
 
| ro = /ro
 
| ru = /ru
 
| si = /si
 
| sk = /sk
 
| sq = /sq
 
| sr = /sr
 
| sv = /sv
 
| ta = /ta
 
| th = /th
 
| tr = /tr
 
| uk = /uk
 
| vi = /vi
 
| yue = /yue
 
| zh = /zh
 
| zh-hans = /zh-hans
 
| zh-hant = /zh-hant
 
| zh-tw = /zh-tw
 
| #default = ERROR
 
}}]]
 
| #default = ERROR
 
}}
 
<noinclude>{{protected}}
 
== Usage ==
 
The main purpose of this template is to retain consistency across multiple translated pages. Using {{tl|lang}} will switch translations based on the value of <code><nowiki>{{SUBPAGENAME}}</nowiki></code>.
 
  
* To define a language, simply use the code <code>| xx = </code> and then add your translation after (replacing xx with the correct code from below).
+
    // Blacklist certain namespaces from being placed in categories. -->
  
{| class="wikitable grid" style="margin: 1em 0;"
+
  | user
! Available languages
+
  | team fortress wiki
| af, ar, az, bcc, bg, br, ca, cs, da, de, el, es, fa, fi, fr, gl, gu, he, hu, id, it, ja, ka, ko, ksh, kw, mk, ml, mr, ms, nl, no, oc, pl, pt, ro, ru, si, sk, sq, sr, sv, ta, th, tr, uk, vi, yue, zh, zh-hans, zh-hant, zh-tw
+
  | user talk
|}
+
  | team fortress wiki talk
 +
  | category talk
 +
  | help talk
 +
  | mediawiki talk
 +
  | template talk
 +
  | file talk
 +
  | talk = <!-- null -->
  
=== Examples ===
+
  | true
Placing
+
  | 1
<pre>
+
  | yes
{{Lang Cat|Scout}}
+
  | y
</pre>
 
on [[Force-A-Nature/ru]] adds
 
<pre>
 
[[Category:Scout/ru]]
 
</pre>
 
to the page.
 
  
[[Category:Templates|Lang Cat]]
+
  | blank
[[Category:Language templates|Lang Cat]]
+
  | none
 +
  | #default = [[Category:{{{1}}}{{if lang}}{{#if:{{{sort|}}}|{{!}}{{{sort|{{BASEPAGENAME}}}}}|<!--No sort specified-->}}]]<!--
 +
-->}}
 +
}}<noinclude>{{doc begin}}
 +
{{tl|lang cat}} places pages in their correct language category. It should only be used directly on [[:Category:Templates|templates]].
 +
 
 +
=== Usage ===
 +
* On [[Scattergun]], {{tlx|lang cat|Scout}} will add the page to [[:Category:Scout]]
 +
* On [[Scattergun/fr]], {{tlx|lang cat|Scout}} will add the page to [[:Category:Scout/fr]]
 +
* On [[Scout]], {{tlx|lang cat|Scout|3=sort= &amp;nbsp;}} will add the page to [[:Category:Scout]], but will use a space character as the sort key so it appears first in the category listing.<br />Note: The space before the &amp;nbsp; tag is important.
 +
 
 +
'''Advanced usage'''
 +
* By default {{tl|lang cat}} will ignore any Talk page or page in the User or Team Fortress Wiki namespace. However, this can be overriden for specific instances by setting the parameter {{code|namespace-override}} to {{code|true}}.
 +
* A specific sort-key can also be defined with the parameter {{code|sort}}. Keep in mind that using this parameter will use the specified sortkey for ''every'' page that the template is used on.
 +
 
 +
[[Category:Templates|Lang cat]]
 +
[[Category:Language templates|Lang cat]]
 +
[[Category:Categorization templates|Lang]]
 
</noinclude>
 
</noinclude>

Latest revision as of 20:02, 29 April 2013

Documentation for Lang cat

{{lang cat}} places pages in their correct language category. It should only be used directly on templates.

Usage

Advanced usage

  • By default {{lang cat}} will ignore any Talk page or page in the User or Team Fortress Wiki namespace. However, this can be overriden for specific instances by setting the parameter namespace-override to true.
  • A specific sort-key can also be defined with the parameter sort. Keep in mind that using this parameter will use the specified sortkey for every page that the template is used on.