>>>>> On Mon, 6 Jun 2016, Chí-Thanh Christopher Nguyễn wrote:
> I'm not totally convinced yet. > Following the BCP-47 spec the format is > Language-Tag = langtag ; normal language tags > langtag = language > ["-" script] > ["-" region] > *("-" variant) > *("-" extension) > ["-" privateuse] > So using the language ca, region es, and variant valencia, the > BCP-47 language tag is ca-es-valencia (or ca-valencia if you omit > the region). Right. Or rather, ca-ES-valencia for the former, because all caps are preferred for the region tag. > POSIX.1-2008[2] as you mentioned defines a slightly different format > for locales > language[_territory][.codeset] > Only LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, and > LC_TIME additionally accept specification of a modifier. > [language[_territory][.codeset][@modifier]] > Where territory is implementation defined and the modifier > "select[s] a specific instance of localization data within a single > category". Which I think does not match what we want with "valencia" > variant of the "ca" language. As I understand it: 1. Gettext documentation says that locale names can be LL_CC or LL_CC@VARIANT. The natural mapping to the (implementation defined) format mentioned by POSIX seems to be that LL, CC, and VARIANT correspond to language, territory, and modifier, respectively. 2. Language codes are taken from ISO 639, namely the two-letter code if one exists, otherwise the three-letter code. 3. Territory codes are taken from ISO 3166-1, usually the two-letter country codes. 4. According to Gettext documentation, "'@VARIANT' can denote any kind of characteristics that is not already implied by the language LL and the country CC." (So IIUC the BCP-47 variant "valencia" would become "@valencia".) > Hence I think POSIX locale cannot handle Catalan Valencian, unless > territory is made accept ISO3166-2 region subdivisions. I haven't found any mention or usage of ISO 3166-2 region subdivisions in the context of locale. Can you provide any references for this? Ulrich
pgpqOl6MMcnlA.pgp
Description: PGP signature