Template:BCP47

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Documentationview · edit · history · purge ]
This documentation is transcluded from Template:BCP47/doc.

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 the HTML lang="" attribute.

Examples

  • Unaffected codes, for example:
    • "{{BCP47|en}}" returns: "en"
  • Changes required by BCP47, using standard codes:
    • "{{BCP47|als}}" returns: "gsw"
    • "{{BCP47|fiu-vro}}" returns: "vro"
    • "{{BCP47|simple}}" returns: "en"
    • "{{BCP47|zh-classical}}" returns: "lzh"
    • "{{BCP47|roa-rup}}" returns: "rup"
  • Changes required by BCP47, currently using private-use extensions:
    • "{{BCP47|nrm}}" returns: "fr-x-nrm"
    • "{{BCP47|roa-tara}}" returns: "it-x-tara"
  • Changes preferable with BCP47 for improved interoperability (not really violations):
    • "{{BCP47|be-x-old}}" returns: "be-tarask"

Usage

{{BCP47 |1= }}

Template parameters

ParameterDescriptionDefaultStatus
1codeemptyoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified