After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 160271 - g_get_language_names() always returns the same list
g_get_language_names() always returns the same list
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.5.x
Other Linux
: High normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2004-12-02 22:24 UTC by Christian Persch
Modified: 2011-02-18 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (2.53 KB, patch)
2004-12-03 18:22 UTC, Christian Persch
none Details | Review

Description Christian Persch 2004-12-02 22:24:20 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.
Comment 1 Matthias Clasen 2004-12-03 15:36:15 UTC
We probably need to do something similar to what we do for g_get_file_encoding()
Comment 2 Christian Persch 2004-12-03 18:22:32 UTC
Created attachment 34461 [details] [review]
proposed fix
Comment 3 Matthias Clasen 2004-12-07 15:20:22 UTC
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().