Re: get list of available locales
- From: Matthew Talbert <ransom1982 gmail com>
- To: Allin Cottrell <cottrell wfu edu>
- Cc: GTK Devel <gtk-app-devel-list gnome org>
- Subject: Re: get list of available locales
- Date: Tue, 15 Sep 2009 23:53:07 -0400
We've implemented this sort of thing -- a language selector that
lets you choose between 13 supported languages -- in gretl,
another GTK app. I'm not sure we're doing it in the best way, but
it seems to work OK. It's definitely fiddly work. To see what we
did, look at gretl_intl.c, lines 398 to 680.
http://gretl.cvs.sourceforge.net/viewvc/gretl/gretl/lib/src/gretl_intl.c?revision=1.61&view=markup
Thanks for your reply. I was afraid that this was the answer. It's
amazing that this is not a more common question.
This bit of code is what I was thinking about doing already. Glad to
have some confirmation that such an approach is workable.
char *test = setlocale(LC_ALL, lcode);
564
565 # ifndef WIN32
566 if (test == NULL) {
567 char lfix[32];
568
569 sprintf(lfix, "%s.UTF-8", lcode); /* Ubuntu, grr */
570 test = setlocale(LC_ALL, lfix);
Thanks again,
Matthew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]