Difference between revisions of "Template:Lang"

From Kerbal Space Program Wiki
Jump to: navigation, search
(+zh-cn;)
(+default; +force can be none;)
Line 1: Line 1:
{{#switch:{{{force|{{SUBPAGENAME}}}}}
+
{{#switch:{{#if: {{{force|}}}|{{{force}}}|{{SUBPAGENAME}}}}
| ar = {{{ar|{{{en|{{{1}}}}}}}}}
+
| ar = {{{ar|{{{default|{{{en|{{{1}}}}}}}}}}}}
| cs = {{{cs|{{{en|{{{1}}}}}}}}}
+
| cs = {{{cs|{{{default|{{{en|{{{1}}}}}}}}}}}}
| da = {{{da|{{{en|{{{1}}}}}}}}}
+
| da = {{{da|{{{default|{{{en|{{{1}}}}}}}}}}}}
| de = {{{de|{{{en|{{{1}}}}}}}}}
+
| de = {{{de|{{{default|{{{en|{{{1}}}}}}}}}}}}
| es = {{{es|{{{en|{{{1}}}}}}}}}
+
| en = {{{en|{{{1}}}}}}
| fi = {{{fi|{{{en|{{{1}}}}}}}}}
+
| es = {{{es|{{{default|{{{en|{{{1}}}}}}}}}}}}
| fr = {{{fr|{{{en|{{{1}}}}}}}}}
+
| fi = {{{fi|{{{default|{{{en|{{{1}}}}}}}}}}}}
| hu = {{{hu|{{{en|{{{1}}}}}}}}}
+
| fr = {{{fr|{{{default|{{{en|{{{1}}}}}}}}}}}}
| it = {{{it|{{{en|{{{1}}}}}}}}}
+
| hu = {{{hu|{{{default|{{{en|{{{1}}}}}}}}}}}}
| ja = {{{ja|{{{en|{{{1}}}}}}}}}
+
| it = {{{it|{{{default|{{{en|{{{1}}}}}}}}}}}}
| ko = {{{ko|{{{en|{{{1}}}}}}}}}
+
| ja = {{{ja|{{{default|{{{en|{{{1}}}}}}}}}}}}
| nl = {{{nl|{{{en|{{{1}}}}}}}}}
+
| ko = {{{ko|{{{default|{{{en|{{{1}}}}}}}}}}}}
| no = {{{no|{{{en|{{{1}}}}}}}}}
+
| nl = {{{nl|{{{default|{{{en|{{{1}}}}}}}}}}}}
| pl = {{{pl|{{{en|{{{1}}}}}}}}}
+
| no = {{{no|{{{default|{{{en|{{{1}}}}}}}}}}}}
| pt = {{{pt|{{{en|{{{1}}}}}}}}}
+
| pl = {{{pl|{{{default|{{{en|{{{1}}}}}}}}}}}}
| pt-br = {{{pt-br|{{{en|{{{1}}}}}}}}}
+
| pt = {{{pt|{{{default|{{{en|{{{1}}}}}}}}}}}}
| ro = {{{ro|{{{en|{{{1}}}}}}}}}
+
| pt-br = {{{pt-br|{{{default|{{{en|{{{1}}}}}}}}}}}}
| ru = {{{ru|{{{en|{{{1}}}}}}}}}
+
| ro = {{{ro|{{{default|{{{en|{{{1}}}}}}}}}}}}
| sv = {{{sv|{{{en|{{{1}}}}}}}}}
+
| ru = {{{ru|{{{default|{{{en|{{{1}}}}}}}}}}}}
| tr = {{{tr|{{{en|{{{1}}}}}}}}}
+
| sv = {{{sv|{{{default|{{{en|{{{1}}}}}}}}}}}}
| zh = {{{zh|{{{en|{{{1}}}}}}}}}
+
| tr = {{{tr|{{{default|{{{en|{{{1}}}}}}}}}}}}
| zh-cn = {{{zh-cn|{{{en|{{{1}}}}}}}}}
+
| zh = {{{zh|{{{default|{{{en|{{{1}}}}}}}}}}}}
| zh-hans = {{{zh-hans|{{{en|{{{1}}}}}}}}}
+
| zh-cn = {{{zh-cn|{{{default|{{{en|{{{1}}}}}}}}}}}}
| zh-hant = {{{zh-hant|{{{en|{{{1}}}}}}}}}
+
| zh-hans = {{{zh-hans|{{{default|{{{en|{{{1}}}}}}}}}}}}
| #default = {{{en|{{{1|}}}}}}
+
| zh-hant = {{{zh-hant|{{{default|{{{en|{{{1}}}}}}}}}}}}
 +
| #default = {{{default|{{{en|{{{1}}}}}}}}}
 
}}<noinclude>{{doc start}}
 
}}<noinclude>{{doc start}}
 
The main purpose of this template is to retain consistency across multiple translated pages. {{tlx|lang}} will detect the language page name, and display that language's translation by itself (e.g. if a template with Polish translations in it, when used on a Polish page, only the Polish translations will be displayed).
 
The main purpose of this template is to retain consistency across multiple translated pages. {{tlx|lang}} will detect the language page name, and display that language's translation by itself (e.g. if a template with Polish translations in it, when used on a Polish page, only the Polish translations will be displayed).
Line 41: Line 42:
 
* '''Forcing a particular language''': the parameter {{code|force}} is available to force a particular language to show regardless of the {{code|SUBPAGENAME}}. It can be useful on some templates to force English to always show.
 
* '''Forcing a particular language''': the parameter {{code|force}} is available to force a particular language to show regardless of the {{code|SUBPAGENAME}}. It can be useful on some templates to force English to always show.
 
::Example: {{tlx|lang|2=force=en}}
 
::Example: {{tlx|lang|2=force=en}}
 +
* '''Default language''': the parameter {{code|default}} can be defined and will be selected instead of the English if set.
  
 
=== Examples ===
 
=== Examples ===

Revision as of 20:40, 24 May 2013

{{{1}}}

Documentation for Lang

The main purpose of this template is to retain consistency across multiple translated pages. {{lang}} will detect the language page name, and display that language's translation by itself (e.g. if a template with Polish translations in it, when used on a Polish page, only the Polish translations will be displayed).

By default, {{lang}} will display English if no translation is available for a particular language.

Usage

  • To define a language, simply use the code | xx = and then add your translation after (replacing xx with the correct code from below).
Available languages ar, cs, da, de, es, fi, fr, hu, it, ja, ko, nl, no, pl, pt, pt-br, ro, ru, sv, tr, zh, zh-cn, zh-hans, zh-hant

Options

  • Forcing a particular language: the parameter force is available to force a particular language to show regardless of the SUBPAGENAME. It can be useful on some templates to force English to always show.
Example: {{lang|force=en}}
  • Default language: the parameter default can be defined and will be selected instead of the English if set.

Examples

{{lang
| de = Willkommen
| en = Welcome
| ja = Irashaimasu
| pl = Witaj
}}