[csswg-drafts] Consider Canonicalization of language tags in :lang() selector maching (#4154)

frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== Consider Canonicalization of language tags in :lang() selector maching ==
Cantonese may be described with any of the following language tags:
* `zh-HK` (most common, legacy)
* `zh-yue` (also legacy)
* `yue` (current most appropriate value)

Even though these refer to the same language, `:lang(yue)` would only match the last one.

[RFC 5646 section 4.5](https://tools.ietf.org/html/rfc5646#section-4.5) together with [the IANA Language Subtag Registry](https://www.iana.org/assignments/language-subtag-registry) define canonicalization and mappings that would allow to match the last two (by . [RFC4647 section 3.2](https://tools.ietf.org/html/rfc4647#section-3.2) says we _should_ use this.

The last paragraph of that same section 3.2 also says we may also want to consider mappings like zh-HK to zh-yue, and that too could seems appropriate, but as far as I know there’s no equivalent to IANA Language Subtag registry for such mappings.

While it is possible for authors to deal with this themself by using `:lang(yue, zh-yue, zh-HK)`, to the extend we can automate this, they shouldn't have to deal with this.

(I'm taking Cantonese as an example, but the same can be said about other languages)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4154 using your GitHub account

Received on Saturday, 27 July 2019 22:38:49 UTC