This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: the description of LANGUAGE


On 01:20 Thu 04 Dec     , Petr Baudis wrote:
>   Hi,
> 
> On Sun, Nov 30, 2008 at 09:47:17PM +0800, Zhang Le wrote:
> > Sorry, please take this one. Just did a little modification.
> > 
> > LANGUAGE:
> > When determining the language (e.g. en or en_US) of a locale category (e.g.
> > LC_MESSAGES), if the locale category is itself already set to a valid locale
> 
>   I think you should make clear this is only for the translation
> purposes, and it _usually_ only affects LC_MESSAGES - exceptions are
> rare, e.g.:
> 
> 	http://google.com/codesearch?hl=en&lr=&q=dcgettext.*LC_[^M]

Thank you for pointing this out.
LANGUAGE is used in gettext, so it should only affect LC_MESSAGES.

> 
> > name (note, must be a locale name, a languge name won't work. e.g. 'en_US' is
> > ok, but 'en' is not) in a system, no matter it is set explicitly or implicitly
> > using LC_ALL or LANG, LANGUAGE's value will override this locale category's
> > original setting. LANGUAGE's value is a colon separated list of language codes.
> 
>   This is unnecessarily entangled - the locale category must simply be
> set to a valid locale different than C (POSIX).

Yeah, but someone may think LANGUAGE by itself will work, which is not correct.

> Also, LANGUAGE's value is a list of locale names, not language codes.

Actually, this works:
1. first clear environment
2. LC_MESSAGES=zh_CN LC_CTYPE=zh_CN LANGUAGE=zh command

And please take a look at this:
http://www.gnu.org/software/gettext/FAQ.html#localename

> 
> > The list will be scanned from left to right, the first valid language code will
> > take effect.
> 
>   This is not quite correct, only the first valid language code with
> translation available will take effect.

Yeah, but determining whether mo file is available or not is the next action to take.
Anyway, I will mention this in my next version.

> 
> -- 
> 				Petr "Pasky" Baudis
> People who take cold baths never have rheumatism, but they have
> cold baths.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]