1 |
Ulrich Mueller schrieb: |
2 |
>> POSIX.1-2008[2] as you mentioned defines a slightly different format |
3 |
>> for locales |
4 |
> |
5 |
>> language[_territory][.codeset] |
6 |
> |
7 |
>> Only LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, and |
8 |
>> LC_TIME additionally accept specification of a modifier. |
9 |
> |
10 |
>> [language[_territory][.codeset][@modifier]] |
11 |
> |
12 |
>> Where territory is implementation defined and the modifier |
13 |
>> "select[s] a specific instance of localization data within a single |
14 |
>> category". Which I think does not match what we want with "valencia" |
15 |
>> variant of the "ca" language. |
16 |
> |
17 |
> As I understand it: |
18 |
> |
19 |
> 1. Gettext documentation says that locale names can be LL_CC or |
20 |
> LL_CC@VARIANT. The natural mapping to the (implementation defined) |
21 |
> format mentioned by POSIX seems to be that LL, CC, and VARIANT |
22 |
> correspond to language, territory, and modifier, respectively. |
23 |
> |
24 |
> 2. Language codes are taken from ISO 639, namely the two-letter code |
25 |
> if one exists, otherwise the three-letter code. |
26 |
|
27 |
Yes. |
28 |
|
29 |
> 3. Territory codes are taken from ISO 3166-1, usually the two-letter |
30 |
> country codes. |
31 |
|
32 |
Yes. |
33 |
|
34 |
> 4. According to Gettext documentation, "'@VARIANT' can denote any kind |
35 |
> of characteristics that is not already implied by the language LL and |
36 |
> the country CC." (So IIUC the BCP-47 variant "valencia" would become |
37 |
> "@valencia".) |
38 |
|
39 |
This I think is wrong and collides with POSIX. |
40 |
POSIX modifiers are not allowed for LANG or LC_ALL in POSIX.1-2008[1] |
41 |
Section 8.2 says you can have at most one modifier field to "select a |
42 |
specific instance of localization data within a single category", which I |
43 |
don't think applies because it is its own locale, not an instance of an |
44 |
existing one. Furthermore (but that doesn't apply in our use case), POSIX |
45 |
spec lists the example |
46 |
LC_COLLATE=De_DE@dict |
47 |
So what if you want Catalan Valencian with dictionary order? Or if someone |
48 |
hypothetically came up with a different script? |
49 |
|
50 |
>> Hence I think POSIX locale cannot handle Catalan Valencian, unless |
51 |
>> territory is made accept ISO3166-2 region subdivisions. |
52 |
> |
53 |
> I haven't found any mention or usage of ISO 3166-2 region subdivisions |
54 |
> in the context of locale. Can you provide any references for this? |
55 |
|
56 |
As I wrote before, it is not used. But I think it is the only spec-compliant |
57 |
way to marry POSIX locales with Catalan Valencian. BCP-47 does it in a more |
58 |
natural way. |
59 |
|
60 |
|
61 |
Best regards, |
62 |
Chí-Thanh Christopher Nguyễn |
63 |
|
64 |
[1] |
65 |
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02 |