[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
POSIX gettext() and the LANGUAGE environment variable
From: |
Bruno Haible |
Subject: |
POSIX gettext() and the LANGUAGE environment variable |
Date: |
Tue, 04 May 2021 00:05:32 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; ) |
https://posix.rhansen.org/p/gettext_split
says (line 72)
"For the LANGUAGE search, the value of the LANGUAGE environment
variable shall be a list of one or more locale names separated
by a colon (':') character."
This is NOT how GNU gettext behaves. If POSIX standardizes it like this,
GNU libc and GNU gettext will have the choice among
(a) forcing users to specify their preferences in a user-unfriendly way, or
(b) violating POSIX in this point.
I will vote for (b).
Namely, what gettext expects in the LANGUAGE environment variable is
documented in
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html
In a modern glibc system, the locale names are essentially
C
POSIX
en_US.UTF-8
de_DE.UTF-8
fr_FR.UTF-8
pt_BR.UTF-8
etc.
We do NOT want that user who wants to see messages in Arabic (1st preference)
or French (2nd preference) has to set
LANGUAGE=ar_EG.UTF-8:fr_FR.UTF-8
We want that the user merely has to write
LANGUAGE=ar:fr
Suggested wording change:
"For the LANGUAGE search, the value of the LANGUAGE environment
variable shall be a list of one or more language identifiers.
A language identifier is a locale name with the '.codeset' part
removed and optionally also the territory and/or the modifiers removed.
In the simplest case, a language identifier consists of just an ISO 639-1
code."
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- POSIX gettext() and the LANGUAGE environment variable,
Bruno Haible <=