Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:BCP47: Difference between revisions

Template page
m fix incorrect nesting of some HTML comments
Per BCP 47, “und” SHOULD NOT be used unless a language tag is required. According to MDN, an empty lang attribute explicitly conveys the same meaning as “und”, thus it’s unnecessary and SHOULD NOT be used.
Line 1: Line 1:
{{#switch:{{lc:{{{1|}}}}}
{{#switch:{{lc:{{{1|}}}}}
<!-- pseudo codes -->
<!-- pseudo codes -->
||root|default|i-default=und<!-- or ={{int:lang}}? (the best user default), or =en? (the default "ContentLanguage" for unlocalized data on Meta) -->
||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 "und".
   (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}}}}}}
     | und
     |
     | {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}}
     | {{#ifeq: {{{1|}}} | {{urlencode:{{{1|}}}}}
       | {{lc:{{{1|}}}}}
       | {{lc:{{{1|}}}}}
      | und
       }}
       }}
    | und
     }}
     }}
  | und
   }}
   }}
}}<noinclude>{{Documentation}}</noinclude>
}}<noinclude>{{Documentation}}</noinclude>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.