Template:BCP47/doc: Difference between revisions
Template page
More actions
| Line 8: | Line 8: | ||
== Examples == | == Examples == | ||
* Unaffected codes, 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}}" (alias of "no" on Wikimedia sites ?) | ||
Revision as of 09:09, 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" (alias of "no" 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|no-bok}}" returns: "nb" (alias of "no" 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) 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:
- "
{{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|de-formal}}" returns: "de" - "
{{BCP47|nl-informal}}" returns: "nl" - "
{{BCP47|nrm}}" returns: "nrf" - "
{{BCP47|roa-tara}}" returns: "it-x-tara"
- "