Re: Language env variables order



Fatih Demir <kabalak@gmx.net> writes:

> I want to make the init of gtranslator sweeter, so I'm thinbking about
> grepping env variables $LANG, $LANGUAGE etc. for an appropriate variable
> to set it automatically as the translator's language for the user..
> 
> What's the right order for checking the env variables? What should I
> check first, second..
> 
> Is $LANG not the primary one for such things?

>From locale(7):

************************************************************
 If the second argument to setlocale() is empty string, "",
 for the default locale, it is determined using the follow­
 ing steps:

 1.     If there is a non-null environment variable LC_ALL,
        the value of LC_ALL is used.

 2.     If  an  environment  variable with the same name as
        one of the categories above exists and is non-null,
        its value is used for that category.

 3.     If  there  is a non-null environment variable LANG,
        the value of LANG is used.

 ***********************************************************
The "categories above" refers to LC_NUMERIC, LC_MONETARY, LC_CTYPE etc.


-- 
Trond Eivind Glomsrød
Red Hat, Inc.

Translations for Red Hat Linux: http://sources.redhat.com/rhl/i18n/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]