Detecting the native locale
Sayamindu Dasgupta
sayamindu at gmail.com
Sat Mar 8 12:04:25 EST 2008
Hi,
You can take a look at the implementation
http://library.gnome.org/devel/glib/stable/glib-I18N.html#g-get-language-names
There are four environment variables that are taken into account for
this kind of work
'LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'
I had made a method to implement the same thing in Python long time
back (http://sayamindu.randomink.org/misc/get_language_names4.pytxt)
-hth-
Sayamindu
On Sat, Mar 8, 2008 at 9:12 PM, Joshua Minor <j at lux.vu> wrote:
> I'm trying to make Speak pick its default accent based on the native
> language of the laptop (per Walter's request http://dev.laptop.org/ticket/6656
> ) This is a bit different from normal localization - although I
> need to do that also - because it is not just replacing strings. My
> guess is that I can just look at the environment variable $LANG and
> pick an accent with a similar ISO 639 language code.
>
> Can anyone confirm that using $LANG is appropriate for this?
>
> Also, aside from just setting $LANG to something else, how can I test
> that this actually works?
>
> -josh
>
> _______________________________________________
> Devel mailing list
> Devel at lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
--
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
More information about the Devel
mailing list