GNOME Bugzilla – Bug 160271
g_get_language_names() always returns the same list
Last modified: 2011-02-18 16:09:33 UTC
After I set the LANGUAGE to a different value (I'd just use setlocale(), but LANGUAGE takes precedence for g_get_language_names), g_get_language_names() still returns the same list of identifiers as before, since it only initialises its list once, on the first call.
We probably need to do something similar to what we do for g_get_file_encoding()
Created attachment 34461 [details] [review] proposed fix
2004-12-07 Matthias Clasen <mclasen@redhat.com> * glib/gutils.c (g_get_language_names): Update the returned value after locale changes. (#160271, Christian Persch) (_g_utils_thread_init): Initialize the language name cache before going threaded. * glib/gthread.c (g_thread_init_glib): Call _g_utils_thread_init(). * glib/gthreadinit.h: Add _g_utils_thread_init().