Template:SanitiseLanguageCode: Difference between revisions
Appearance
AndrewSayers (talk | contribs) No edit summary |
AndrewSayers (talk | contribs) No edit summary |
||
| Line 54: | Line 54: | ||
| zh-tw | | zh-tw | ||
| zh_tw = zh_TW | | zh_tw = zh_TW | ||
| {{# | | {{#ifeq:{{MaybeBoolean|{{{IgnoreInvalid|0}}}}}|0|[[Category:Pages with invalid locales]]|}}}} | ||
}} | }}</onlyinclude></pre> | ||
<templatedata> | <templatedata> | ||
{ | { | ||
Revision as of 16:45, 21 February 2026
<onlyinclude>{{#switch:{{lc:{{{1|}}}}}|
| ar
| be
| bn
| ca
| cn
| cs
| da
| de
| el
| en
| eo
| es
| fa
| fi
| fr
| he
| hu
| id
| it
| ja
| jp
| ko
| lv
| ms
| nb
| nl
| nn
| no
| pl
| pt
| ro
| ru
| se
| si
| sk
| sr
| sv
| ta
| te
| tr
| uk
| us
| vi
| zh = {{lc:{{{1|}}}}}
| pt-br
| pt_br = pt_BR
| pt-pt
| pt_pt = pt_PT
| zh-cn
| zh_cn = zh_CN
| zh-hk
| zh_hk = zh_HK
| zh-tw
| zh_tw = zh_TW
| {{#ifeq:{{MaybeBoolean|{{{IgnoreInvalid|0}}}}}|0|[[Category:Pages with invalid locales]]|}}}}
}}</onlyinclude>
Convert language-code parameters ("eN", "Pt-Br" etc.) to a canonical version, convert unknown values to the empty string. Please call this from other templates to sanitise your boolean values.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Value | 1 | Value to convert to a language code
| Unknown | required |
| Ignore invalid? | IgnoreInvalid | If the parameter is invalid parameter, do not add this page to the "Pages with invalid language codes" category.
| Boolean | optional |