Template:Wikilangcode: Difference between revisions
From Penguin Ice Wiki
(Created page with "{{#switch:{{lc:{{{1|}}}}} <!-- pseudo codes --> ||root|default=www |#default = {{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}} | {{#ifeq: {{lc:{{#titleparts:{{{1|}}}|1}}}} | {{ucfirst:{{lc:{{#titleparts:{{{1|}}}|1}}}}}} | www | {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}} | {{lc:{{{1|}}}}} | www }} | www }} | www }} }}") |
No edit summary |
||
| Line 2: | Line 2: | ||
<!-- pseudo codes --> | <!-- pseudo codes --> | ||
||root|default=www | ||root|default=www | ||
<!-- current BCP47 violations by Wikimedia sites, which can be fixed using standard tags when they exist --> | |||
|gsw=als | |||
|sgs=bat-smg | |||
|vro=fiu-vro | |||
|rup=roa-rup | |||
|en-x-simple=simple<!-- could be "en-x-simple" but actually a subset within standard "en" for HTML --> | |||
|sr-cyrl|sr-ec=sr | |||
|sr-latn|sr-el=sr | |||
|zh-classical=lzh | |||
<!-- other current BCP47 violations by Wikimedia sites, fixed using private-use extensions (if they are needed, labels are limited to 8 letters/digits) --> | |||
|cbk-x-zam=cbk-zam | |||
|de-formal=de<!-- could be "de-x-formal", but actually a subset within standard "de" for HTML/XML --> | |||
|it-x-eml=eml=<!-- retired code, two competing standard codes for these Emilian variants of Italian --> | |||
|map-x-bms=map-bms | |||
|ro-cyrl|mo=ro<!-- retired, best fit on Wikimedia sites, but no longer working in interwikis (Wikipedia project locked down) --> | |||
|nl-informal=nl<!-- could be "nl-x-informal", but actually a subset within standard "nl" for HTML/XML --> | |||
|fr-x-nrm=nrm<!-- could be roa-x-nrm using a family subtag, but a "private-use" extension of French is still much better for language/script fallbacks --> | |||
|it-x-tara=roa-tara | |||
<!-- conforming BCP47 "private-use" extensions used by Wikimedia, which are no longer needed, and improved using now standard codes --> | |||
|be-tarask=be-x-old | |||
<!-- conforming but ambiguous BCP47 codes used by Wikimedia in a more restrictive way, with more precision --> | |||
|nb|nn=no<!-- "no" means Bokmål on Wikimedia sites, "nb" is not used --> | |||
|bho=bh<!-- "bh"="bih" is a language family, interpreted in Wikimedia as the single language "bho", even if its interwiki code remains bh) --> | |||
|tl-tglg=tgl<!-- "tgl" on Wikimedia is the historic variant of the Tagalog macrolanguage ("tl" or "tgl", "tl" recommended for BCP47), written in the Baybayin script ("tglg") --> | |||
<!-- conforming BCP47 "inherited" tags, strongly discouraged and replaced by their recommended tags (complete list that should not be augmented now) --> | |||
|art-lojban=jbo<!-- still used in some old Wikimedia templates --> | |||
|en-gb-oed|en-gb=en<!-- no preferred replacement, could be "en-gb-x-oed" but actually a subset within standard "en-gb" --> | |||
|i-ami=ami | |||
|i-bnn=bnn | |||
|i-hak=hak | |||
|i-klingon=tlh | |||
|i-lux=lb | |||
|i-navajo=nv | |||
|i-pwn=pwn | |||
|i-tao=tao | |||
|i-tay=tay | |||
|i-tsu=tsu | |||
|no-bok=no<!-- still used in some old Wikimedia templates --> | |||
|no-nyn=no<!-- still used in some old Wikimedia templates --> | |||
|sgn-be-fr|sfb=fr | |||
|sgn-be-nl|vgt=nl | |||
|sgn-ch-de|sgg=de | |||
|zh-guoyu|cmn=zh<!-- this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin --> | |||
|zh-hakka=hak | |||
|zh-min|zh-tw=zh<!-- no preferred replacement, could be "zh-x-min", but actually a subset within standard "zh-tw"; not necessarily "nan" --> | |||
|nan=zh-min-nan<!-- used in some old Wikimedia templates and in interwikis --> | |||
|zh-xiang|hsn=zh<!-- no wikipedia --> | |||
<!-- conforming BCP47 "redundant" tags, discouraged and replaced by their recommended tags (complete list that should not be augmented now) --> | |||
|sgn-br|bzs=pt | |||
|sgn-co|csn=es | |||
|sgn-de|gsg=de | |||
|sgn-dk|dsl=da | |||
|sgn-es|ssp=es | |||
|sgn-fr|fsl=fr<!-- still used in some old Wikimedia templates --> | |||
|sgn-gb|bfi=en | |||
|sgn-gr|gss=el | |||
|sgn-ie|isg=en<!-- or cy ? --> | |||
|sgn-it|ise=it | |||
|sgn-jp|jsl=ja | |||
|sgn-mx|mfs=es | |||
|sgn-ni|ncs=es | |||
|sgn-nl|dse=nl | |||
|sgn-no|nsl=no | |||
|sgn-pt|psr=pt | |||
|sgn-se|swl=sv | |||
|sgn-us|ase=en<!-- still used in some old Wikimedia templates --> | |||
|sgn-za|sfs=en | |||
|zh-cmn|cmn=zh<!-- still used in some old Wikimedia templates, this could be an alias of "zh" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin --> | |||
|zh-cmn-Hans|cmn-hans=zh<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hans" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin --> | |||
|zh-cmn-Hant|cmn-hant=zh<!-- still used in some old Wikimedia templates, this could be an alias of "zh-hant" on Wikimedia sites, which do not use "cmn" but assume "zh" is Mandarin --> | |||
|zh-gan=gan<!-- still used in some old Wikimedia templates --> | |||
|zh-wuu=wuu<!-- still used in some old Wikimedia templates --> | |||
|yue=zh-yue<!-- still used in some old Wikimedia templates and in interwikis --> | |||
<!-- other "inherited" tags of the standard, strongly discouraged as they are deleted, but with no defined replacement there are left unaffected (complete list that should not be augmented now)--> | |||
|cel-gaulish|cel-x-gaulish<!--?--> | |||
|i-default|und-x-default<!--?, or ={{int:lang}}? (the best user default), or =en? (the default "ContentLanguage" for unlocalized data on Meta)--> | |||
|i-enochian|x-enochian<!--?--> | |||
|i-mingo|x-mingo<!--?--> | |||
= www | |||
<!-- other standard "redundant" tags, which were unnecessarily registered (they validate with standard subtags) and that are left unaffected (complete list that should not be augmented now)--> | |||
|az-arab | |||
|az-cyrl | |||
|az-latn=az | |||
|be-cyrl | |||
|be-latn=be | |||
|bs-cyrl | |||
|bs-latn=bs | |||
|de-1901 | |||
|de-1996 | |||
|de-at-1901 | |||
|de-at-1996 | |||
|de-ch-1901 | |||
|de-ch-1996 | |||
|de-de-1901 | |||
|de-de-1996=de | |||
|en-latn | |||
|en-dsrt | |||
|en-boont | |||
|en-scouse=en | |||
|iu-cans | |||
|iu-latn=iu | |||
|mn-cyrl | |||
|mn-mong=mn | |||
|sl-nedis | |||
|sl-rozaj=sl | |||
|sr-cyrl | |||
|sr-latn=sr | |||
|tg-arab | |||
|tg-cyrl=tg | |||
|uz-cyrl | |||
|uz-latn=uz | |||
|yi-latn=yi | |||
|zh-cn | |||
|zh-hk | |||
|zh-mo | |||
|zh-sg | |||
|zh-tw | |||
|zh-hans | |||
|zh-hans-cn | |||
|zh-hans-hk | |||
|zh-hans-mo | |||
|zh-hans-sg | |||
|zh-hans-tw | |||
|zh-hant | |||
|zh-hant-cn | |||
|zh-hant-hk | |||
|zh-hant-mo | |||
|zh-hant-sg | |||
|zh-hant-tw=zh | |||
<!-- standard special codes --> | |||
|mul | |||
|und=www | |||
<!-- all other unaffected tags: | |||
Minimal check of validity (valid BCP47 codes are necessarily stable over URLENCODE and #titleparts). | |||
The check ensures that the code contains only ASCII letters, digits or hyphens, and starts by a letter. | |||
This check is necessary to avoid a severe bug in MediaWiki, with some values of parameter 1, notably with | |||
urlencoded characters (including quotes, braces, ampersands...), slashes, or any HTML or wiki formatting | |||
(see also [[Template:Pagelang]]). If successful, force result to lowercase; otherwise return "und". | |||
--> | |||
|#default = | |#default = | ||
{{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}} | {{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}} | ||
Latest revision as of 00:00, 30 June 2026
www