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 60606 - automatically set locale
automatically set locale
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-09-16 20:26 UTC by Havoc Pennington
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2001-09-16 20:26:53 UTC
gtk_init() should set the locale by default. We could have some 
override if required (gtk_do_not_set_locale()?)
Failure to call gtk_set_locale() is pretty FAQ-causing.
Comment 1 Owen Taylor 2001-09-19 21:40:01 UTC
Temporarily put on the API milestone to consider. Disadvantage
is that if you aren't expecting localization, things like
sprintf being localized may take you by suprise.

It's not quite so much of an issue as in 1.2 since we don't
render through Xlib for almost anything, still dialogs
won't be localized, g_locale_to_utf8() won't work for
iso-8859-1 etc, if you don't call gtk_set_locale() [or
setlocale() ]
Comment 2 Owen Taylor 2001-10-10 16:58:17 UTC
Wed Oct 10 12:48:38 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_init_check): Call setlocale (LC_ALL, "").
	(#60606)

	* gtk/gtkmain.c (gtk_disable_setlocale): Add function
	to disable calling setlocale (LC_ALL, "").

	* gtk/gtkmain.c (gtk_set_locale): Indicate in the 
	docs that this function is not typically useful.

	* gdk/x11/{gdkim-x11.c,gdkmain-x11.c,gdkprivate-x11.h}: 
	Automatically initialize GDK for the current locale
	on gdk_init(). Don't reset locale to C when
	XSupportsLocale() fails.

	* gdk/linux-fb/gdkim-fb.c (gdk_set_locale): Remove
	useless checks for UTF-8 locale breakage that mattered
	only for X.

	* examples/calendar/calendar.c
	tests/{testgtk.c,testtext.c,testcalendar.c}: Remove calls to 
	gtk_set_locale().