Template:BCP47/doc

{	"description": "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).", "format": "inline", "params": { "1": {			"label": "MediaWiki language code", "description": "The MediaWiki language code that should be translated to BCP 47.", "type": "line", "required": true }	} }

Use this template only in HTML  attributes or in CSS   selectors, for tagging the linguistic contents or for creating localisations.

Examples

 * Unaffected codes (most of them, valid for use HTML/XML/CSS, are not valid interwikis), for example:
 * " " returns: ""
 * " " returns: "" (same as "no" only where it's used by interwikis on Wikimedia sites)
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * 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):
 * " " returns: ""
 * " " returns: ""
 * " " returns: "" (it's an old ISO 639-1 code for a language family, valid for BCP47 but not recommended, but Wikimedia uses it to mean only "bho" in that family, and replaces this ISO 639-1 code in HTML contents by the ISO 639-3 code)
 * " " returns: ""
 * " " returns: "" (same as "no", only where "no" is used by interwikis on Wikimedia sites to mean only Bokmål plus Riksmål as its minor dialectal variant, but not Nynorsk as allowed in BCP47 and ISO639-1, where "no" is a macrolanguage)
 * " " returns: ""
 * " " returns: "" (alias of "zh" on Wikimedia sites ?)
 * " " returns: ""
 * " " returns: ""
 * 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):
 * " " returns: "" (alias of "en"?)
 * " " returns: "" (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):
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * Changes required by BCP47 (due to standard violation), currently using private-use extensions:
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: "" (note that Norman is actually an unencoded macrolanguage with three separate modern branches: one is the continental minority regional language, considered as a variant of French and called "Normand" in French, the two others are Jériais and Guernésiais, both having now local official status in Jersey and Guernsey as individual languages; none of these three modern languages, or the macrolanguage if there's one, or the historic Old Norman from which they are descending, are also encoded).
 * " " returns: ""
 * Invalid codes detected:
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""
 * " " returns: ""