Template
Difference between revisions of "BCP47"
m (fix incorrect nesting of some HTML comments) |
WikiLucas00 (talk | contribs) m (1 revision imported) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#switch:{{lc:{{{1|}}}}} | {{#switch:{{lc:{{{1|}}}}} | ||
<!-- pseudo codes --> | <!-- pseudo codes --> | ||
− | ||root|default|i-default= | + | ||root|default|i-default=<!-- empty language tag means unknown per the HTML spec --><!-- or ={{int:lang}}? (the best user default), or =en? (the default "ContentLanguage" for unlocalized data on Meta) --> |
<!-- current BCP47 violations by Wikimedia sites, which can be fixed using standard tags when they exist --> | <!-- current BCP47 violations by Wikimedia sites, which can be fixed using standard tags when they exist --> | ||
Line 139: | Line 139: | ||
This check is necessary to avoid a severe bug in MediaWiki, with some values of parameter 1, notably with | 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 | urlencoded characters (including quotes, braces, ampersands...), slashes, or any HTML or wiki formatting | ||
− | (see also [[Template:CURRENTCONTENTLANGUAGE]]). If successful, force result to lowercase; otherwise return | + | (see also [[Template:CURRENTCONTENTLANGUAGE]]). If successful, force result to lowercase; otherwise |
+ | return an empty language tag. | ||
--> | --> | ||
|#default = | |#default = | ||
{{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}} | {{#ifeq: {{#titleparts:{{{1|}}}|1}} | {{#titleparts:{{{1|}}}||-1}} | ||
| {{#ifeq: {{lc:{{#titleparts:{{{1|}}}|1}}}} | {{ucfirst:{{lc:{{#titleparts:{{{1|}}}|1}}}}}} | | {{#ifeq: {{lc:{{#titleparts:{{{1|}}}|1}}}} | {{ucfirst:{{lc:{{#titleparts:{{{1|}}}|1}}}}}} | ||
− | | | + | | |
| {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}} | | {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}} | ||
| {{lc:{{{1|}}}}} | | {{lc:{{{1|}}}}} | ||
− | |||
}} | }} | ||
− | |||
}} | }} | ||
− | |||
}} | }} | ||
}}<noinclude>{{Documentation}}</noinclude> | }}<noinclude>{{Documentation}}</noinclude> |
Latest revision as of 15:35, 13 May 2023
Lua error in package.lua at line 80: module 'strict' not found.