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/doc: Difference between revisions

Template page
Line 10: Line 10:
* Unaffected codes (most of them, valid for use HTML/XML/CSS, are not valid interwikis), for example:
* Unaffected codes (most of them, valid for use HTML/XML/CSS, are not valid interwikis), for example:
** "<code><nowiki>{{BCP47|en}}</nowiki></code>" returns: "{{BCP47|en}}"
** "<code><nowiki>{{BCP47|en}}</nowiki></code>" returns: "{{BCP47|en}}"
** "<code><nowiki>{{BCP47|nb}}</nowiki></code>" returns: "{{BCP47|nb}}" (alias of "no" on Wikimedia sites ?)
** "<code><nowiki>{{BCP47|nb}}</nowiki></code>" returns: "{{BCP47|nb}}" (same as "no" only where it's used by interwikis on Wikimedia sites)
** "<code><nowiki>{{BCP47|zh-hans}}</nowiki></code>" returns: "{{BCP47|zh-hans}}"
** "<code><nowiki>{{BCP47|zh-hans}}</nowiki></code>" returns: "{{BCP47|zh-hans}}"
** "<code><nowiki>{{BCP47|zh-hant}}</nowiki></code>" returns: "{{BCP47|zh-hant}}"
** "<code><nowiki>{{BCP47|zh-hant}}</nowiki></code>" returns: "{{BCP47|zh-hant}}"
Line 17: Line 17:
** "<code><nowiki>{{BCP47|be-x-old}}</nowiki></code>" returns: "{{BCP47|be-x-old}}"
** "<code><nowiki>{{BCP47|be-x-old}}</nowiki></code>" returns: "{{BCP47|be-x-old}}"
** "<code><nowiki>{{BCP47|mo}}</nowiki></code>" returns: "{{BCP47|mo}}"
** "<code><nowiki>{{BCP47|mo}}</nowiki></code>" returns: "{{BCP47|mo}}"
** "<code><nowiki>{{BCP47|no-bok}}</nowiki></code>" returns: "{{BCP47|no-bok}}" (alias of "no" on Wikimedia sites ?)
** "<code><nowiki>{{BCP47|no-bok}}</nowiki></code>" returns: "{{BCP47|no-bok}}" (same as "no"only where it's used by interwikis on Wikimedia sites)
** "<code><nowiki>{{BCP47|no-nyn}}</nowiki></code>" returns: "{{BCP47|no-nyn}}"
** "<code><nowiki>{{BCP47|no-nyn}}</nowiki></code>" returns: "{{BCP47|no-nyn}}"
** "<code><nowiki>{{BCP47|zh-cmn}}</nowiki></code>" returns: "{{BCP47|zh-cmn}}" (alias of "zh" on Wikimedia sites ?)
** "<code><nowiki>{{BCP47|zh-cmn}}</nowiki></code>" returns: "{{BCP47|zh-cmn}}" (alias of "zh" on Wikimedia sites ?)

Revision as of 10:07, 19 November 2013

Usage

This template fixes the current violations of the BCP47 standard (for inclusion in the lang HTML attribute) by Wikimedia sites for their language codes.

It also normalizes these codes to lowercase only (though it is not mandatory).

Use this template only in HTML lang="" attributes, in XML xml:lang="" pseudo-attributes, or in CSS lang() selectors.

Examples

  • Unaffected codes (most of them, valid for use HTML/XML/CSS, are not valid interwikis), for example:
    • "{{BCP47|en}}" returns: "en"
    • "{{BCP47|nb}}" returns: "nb" (same as "no" only where it's used by interwikis on Wikimedia sites)
    • "{{BCP47|zh-hans}}" returns: "zh-hans"
    • "{{BCP47|zh-hant}}" returns: "zh-hant"
    • "{{BCP47|zh-cn}}" returns: "zh-cn"
  • Changes preferable with BCP47 for improved interoperability (not really violations, these replacements for HTML/XML/CSS should not be used for interwikis, as long as their domain names are not aliased):
    • "{{BCP47|be-x-old}}" returns: "be-tarask"
    • "{{BCP47|mo}}" returns: "ro-cyrl"
    • "{{BCP47|no-bok}}" returns: "nb" (same as "no"only where it's used by interwikis on Wikimedia sites)
    • "{{BCP47|no-nyn}}" returns: "nn"
    • "{{BCP47|zh-cmn}}" returns: "cmn" (alias of "zh" on Wikimedia sites ?)
    • "{{BCP47|zh-wuu}}" returns: "wuu"
    • "{{BCP47|zh-yue}}" returns: "yue"
  • The following codes are not recommended (they are unnecessary aliases with preferred values) but they are still conforming to the standard and are not affected (this template still does not resolve them to their canonical codes):
    • "{{BCP47|en-latn}}" returns: "en-latn" (alias of "en"?)
    • "{{BCP47|zh-cmn-hans-cn}}" returns: "zh-cmn-hans-cn" (alias of "cmn-hans-cn"? or simply "zh-hans-cn"?)
  • Changes required by BCP47 (due to standard violation), using standard codes when they exist (but these replacements for HTML/XML/CSS conformance are not valid in interwikis, as long as their domains are not aliased):
    • "{{BCP47|als}}" returns: "gsw"
    • "{{BCP47|bat-smg}}" returns: "sgs"
    • "{{BCP47|fiu-vro}}" returns: "vro"
    • "{{BCP47|roa-rup}}" returns: "rup"
    • "{{BCP47|simple}}" returns: "en"
    • "{{BCP47|sr-sc}}" returns: "sr-sc"
    • "{{BCP47|sr-sl}}" returns: "sr-sl"
    • "{{BCP47|zh-classical}}" returns: "lzh"
  • Changes required by BCP47 (due to standard violation), currently using private-use extensions:
    • "{{BCP47|cbk-zam}}" returns: "cbk-x-zam"
    • "{{BCP47|de-formal}}" returns: "de"
    • "{{BCP47|eml}}" returns: "egl"
    • "{{BCP47|map-bms}}" returns: "jv-x-bms"
    • "{{BCP47|nl-informal}}" returns: "nl"
    • "{{BCP47|nrm}}" returns: "nrf"
    • "{{BCP47|roa-tara}}" returns: "it-x-tara"
Cookies help us deliver our services. By using our services, you agree to our use of cookies.