Re: #60606 - automatically set locale



Hi,

Owen Taylor <otaylor redhat com> writes:

> Bug #60606 suggests that gtk_init() should automatically call
> setlocale (LC_ALL, "") and do the other set up done currently
> by gtk_set_locale().
[...]
> The plan, in detail would then be:
> 
>  - Add a gtk_disable_setlocale() call that you can
>    use to make GTK+ not call setlocale().
> 
>  - If this has not been calle,d to setlocale (LC_ALL, "") as
>    the first thing in gtk_init()
> 
>  - Automatically do the rest of the stuff (initializing X for 
>    the locale) that we do in gtk_set_locale() in gtk_init() 
>    even if you call gtk_disable_setlocale().

looks as if you have committed this change, but didn't you meant
to make gtk_disable_setlocale() public ?!

Here's a patch. If it is correct, please commit as I won't have
net access for a few days...


Salut, Sven

Index: gtk/gtkmain.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmain.c,v
retrieving revision 1.178
diff -u -p -r1.178 gtkmain.c
--- gtk/gtkmain.c	2001/10/10 16:56:53	1.178
+++ gtk/gtkmain.c	2001/10/19 08:30:43
@@ -376,7 +376,7 @@ static gboolean do_setlocale = TRUE;
  *
  * Most programs should not need to call this function.
  **/
-static void
+void
 gtk_disable_setlocale (void)
 {
   if (gtk_initialized)
Index: gtk/gtkmain.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmain.h,v
retrieving revision 1.40
diff -u -p -r1.40 gtkmain.h
--- gtk/gtkmain.h	2001/09/21 19:58:35	1.40
+++ gtk/gtkmain.h	2001/10/19 08:30:43
@@ -113,6 +113,8 @@ gchar *get_gtk_win32_directory (gchar *s
 #ifndef GTK_DISABLE_DEPRECATED
 void     gtk_exit                 (gint    error_code);
 #endif /* GTK_DISABLE_DEPRECATED */
+
+void           gtk_disable_setlocale    (void);
 gchar *        gtk_set_locale           (void);
 PangoLanguage *gtk_get_default_language (void);
 gint           gtk_events_pending       (void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]