Template:Language code

From PZwiki
Lock-locked.png
This page has been put into protection by a PZwiki administrator.
Reason: This template is considered High Risk as it appears on multiple pages.
Only users in the sysop user group may edit this page.
Notebook.pngTemplate Documentation

This is a simple metatemplate used to check for a language code.

Usage

Used to check if the value in the first parameter (1) exists in the language code registry, then returns true if it does, and false if it does not.

Parameters

1
The value to check against the language code registry. If this is not specified, the last subpage of the current page ({{SUBPAGENAME}}) is used.

This is recommended to be used in conjunction with an #ifeq expression to determine if true or false before completing an action.

Examples

This example uses this template in conjunction with #ifeq to check if the current page (or subpage) matches a language code.

{{#ifeq: {{Language code}}|true
| Page is in language code registry (or is not a subpage)
| Page is not in language code registry
}}

Produces:

Page is not in language code registry

In replace of the #ifeq expression, you can use {{yesno}} to get a more readable result.

{{yesno|{{Language code}}
| yes = yes
| no = no
}}

Produces:

no

Supported languages

PZwiki:Project Translations shows the currently supported languages both in-game and on the wiki.

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.