This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: the description of LANGUAGE
- From: "Zhang Le" <robert dot zhangle at gmail dot com>
- To: "Petr Baudis" <pasky at ucw dot cz>
- Cc: libc-help at sourceware dot org, drepper at redhat dot com, roland at frob dot com, "Zhang Le" <r0bertz at gentoo dot org>
- Date: Fri, 5 Dec 2008 20:43:30 +0800
- Subject: Re: the description of LANGUAGE
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UpIRxRAFvpMPdu9+wyXypFsTYaffSJX3D0q25DvAFC8=; b=sYx1HCZSAKF57BOZrxInB7yDSH/rlkr9/EmkWyMg8uJJoy0e85dtbf8QV71B4P49Wc 51MbZyAXJXZ/3RP/4QPUCLxxsbvXau8/FgZQDsausRpsjyaudZf1MlV/b30szLOnzPkG qAFKDcI8zoslAMK/YLnXc7fPYONDgGcYseai8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ZDbLx4q2PQ8hZdOt+2H2RQ0h79Po69tXNQekgRtU3lrGAn3lCJKXTb1d0dRThQYmv3 WUMVP4w7PcucA4fmAkzckRrTUNzYMkDFLXCr447iXIbB1AGMIOQXkUnmAaVhE9W+7vTZ Kxa71kbEl+oHunBBifj2XrPv/QSMtkZu+7xRE=
- References: <20081130133656.GA22220@adriano.hkcable.com.hk> <20081130134717.GB22220@adriano.hkcable.com.hk> <20081204002002.GB7239@machine.or.cz> <20081205053706.GB19486@wheatbuild-lx.hongkong.corp.yahoo.com> <20081205102317.GN10491@machine.or.cz>
On Fri, Dec 5, 2008 at 6:23 PM, Petr Baudis <pasky@ucw.cz> wrote:
> On Fri, Dec 05, 2008 at 01:37:07PM +0800, Zhang Le wrote:
>> 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.
>
> ?
>
> I just showed you why that is not the case.
Sorry, when reading your reply, I was in a hurry, I just looked the
first search result which is not a right example.
Of course, now I understand.
But the point is when I wrote this, I thought LANGUAGE is for every
locale category, but forget the fact that dcgettext is mainly used for
LC_MESSAGES.
Also, there is not so many packages install mo file in locale
categories other than LC_MESSAGES.
In my system, there is only one, coreutils, which is in turn just a
symlink to ../LC_MESSAGES/coreutils.mo
>
>> > > 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.
>
> I was addressing the complicated description of locale category setting.
Of course unnecessary complication is not good. And thanks again for
pointing this out.
>
>> > 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
>
> Ah, sorry, I must have mistested this.
That's OK.
--
Zhang Le - Gentoo Developer