501
edits
(Copypasted from TF wiki - only had to adjust the category. Worded very generically, which is goooood.) |
(→Templates without translation switching: forgot dis) |
||
Line 107: | Line 107: | ||
{{tl|if lang}} tests whether the page is a language page, and if it is, it'll output the language code (in this case, it's {{code|/fr}}). So the link in this example will go to [[Welcome/fr]], and the text displayed on the link will be French, as well. | {{tl|if lang}} tests whether the page is a language page, and if it is, it'll output the language code (in this case, it's {{code|/fr}}). So the link in this example will go to [[Welcome/fr]], and the text displayed on the link will be French, as well. | ||
It's important to not put a space in front of {{tl|if lang}} (for example {{code|1=[[Hats <nowiki>{{if lang}}</nowiki>]]}}) This is because, when used in a link, it will produce [[ | It's important to not put a space in front of {{tl|if lang}} (for example {{code|1=[[Hats <nowiki>{{if lang}}</nowiki>]]}}) This is because, when used in a link, it will produce [[Chell/fr]] instead of [[Chell/fr]]. | ||
=== Language categories === | === Language categories === | ||
{{tl|lang cat}} can be particularly handy for placing some templates in categories based on their language. For example, {{tlx|lang cat| | {{tl|lang cat}} can be particularly handy for placing some templates in categories based on their language. For example, {{tlx|lang cat|Characters}} will place German pages in [[:Category:Characters/de]], and French pages in [[:Category:Characters/fr]]. | ||
== Related language templates == | == Related language templates == |