Ulrich Mueller schrieb:
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.

Yes.

3. Territory codes are taken from ISO 3166-1, usually the two-letter
country codes.

Yes.

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".)

This I think is wrong and collides with POSIX.
POSIX modifiers are not allowed for LANG or LC_ALL in POSIX.1-2008[1]
Section 8.2 says you can have at most one modifier field to "select a specific instance of localization data within a single category", which I don't think applies because it is its own locale, not an instance of an existing one. Furthermore (but that doesn't apply in our use case), POSIX spec lists the example
LC_COLLATE=De_DE@dict
So what if you want Catalan Valencian with dictionary order? Or if someone hypothetically came up with a different script?

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?

As I wrote before, it is not used. But I think it is the only spec-compliant way to marry POSIX locales with Catalan Valencian. BCP-47 does it in a more natural way.


Best regards,
Chí-Thanh Christopher Nguyễn

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to