asciidoctor / asciidoctor.org

:globe_with_meridians: Asciidoctor project site. Composed in AsciiDoc. Baked with Awestruct.
https://asciidoctor.org
Other
322 stars 807 forks source link

Country code or language code (or language tag) #933

Closed 747 closed 2 years ago

747 commented 4 years ago

75.1. Translating built-in labels

When converting to DocBook, you can rely on the DocBook toolchain to translate (most) built-in labels. To activate this feature, simply set the lang attribute to a valid country code (which defaults to en for English).

A.2. Built-in Attributes

Attribute name Description Default value Allowed values Header only See also
lang Set the value of the lang attribute on the root element of the output document. en Valid XML country code Translating built-in labels

(emphasis by me)

The country code and the language code are different standards (ISO 3166-1 and ISO 639), and there's no "country code for English". Moreover, there's neither "XML country code" nor "XML language code", by which I think you mean language tag (BCP 47), which is the only binding standard in the XML spec among them.

This confusion brings about actual contradictions in your assets in https://github.com/asciidoctor/asciidoctor/tree/master/data/locale, namely:

Strictly speaking, subtags of a language tag need to be connected by hyphen, not underscore.

mojavelinux commented 2 years ago

The documentation has been updated to clarify that the value of the lang attribute must be a BCP 47 language tag. That's because the attribute value is passed directly to the lang attribute or xml:lang attribute for HTML and DocBook, respectively.

If you believe that one of the locale files is named incorrectly and needs to be changed, feel free to submit a pull request to correct it.