On Win32, as last resort call g_win32_getlocale() to get the current
authorTor Lillqvist <tml@iki.fi>
Wed, 8 Sep 2004 22:44:22 +0000 (22:44 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Wed, 8 Sep 2004 22:44:22 +0000 (22:44 +0000)
2004-09-08  Tor Lillqvist  <tml@iki.fi>

* glib/gutils.c (guess_category_value): On Win32, as last resort
call g_win32_getlocale() to get the current thread locale. There
usually aren't any POSIXish LANG or LC_* environment variables
present on Windows machines.

* glib/glib.def: Add g_get_language_names.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/glib.def
glib/gutils.c

index e4a470c..1afdcd7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-09-08  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (guess_category_value): On Win32, as last resort
+       call g_win32_getlocale() to get the current thread locale. There
+       usually aren't any POSIXish LANG or LC_* environment variables
+       present on Windows machines.
+
+       * glib/glib.def: Add g_get_language_names.
+
 2004-09-07  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gutils.h: 
index e4a470c..1afdcd7 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-08  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (guess_category_value): On Win32, as last resort
+       call g_win32_getlocale() to get the current thread locale. There
+       usually aren't any POSIXish LANG or LC_* environment variables
+       present on Windows machines.
+
+       * glib/glib.def: Add g_get_language_names.
+
 2004-09-07  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gutils.h: 
index e4a470c..1afdcd7 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-08  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (guess_category_value): On Win32, as last resort
+       call g_win32_getlocale() to get the current thread locale. There
+       usually aren't any POSIXish LANG or LC_* environment variables
+       present on Windows machines.
+
+       * glib/glib.def: Add g_get_language_names.
+
 2004-09-07  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gutils.h: 
index e4a470c..1afdcd7 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-08  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (guess_category_value): On Win32, as last resort
+       call g_win32_getlocale() to get the current thread locale. There
+       usually aren't any POSIXish LANG or LC_* environment variables
+       present on Windows machines.
+
+       * glib/glib.def: Add g_get_language_names.
+
 2004-09-07  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gutils.h: 
index e4a470c..1afdcd7 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-08  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (guess_category_value): On Win32, as last resort
+       call g_win32_getlocale() to get the current thread locale. There
+       usually aren't any POSIXish LANG or LC_* environment variables
+       present on Windows machines.
+
+       * glib/glib.def: Add g_get_language_names.
+
 2004-09-07  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gutils.h: 
index f2639f9..6c9abce 100644 (file)
@@ -177,6 +177,7 @@ EXPORTS
        g_get_current_dir
        g_get_current_time
        g_get_home_dir
+       g_get_language_names
        g_get_prgname
        g_get_real_name
        g_get_system_config_dirs
index 2afa8d2..c2fdf46 100644 (file)
@@ -1747,6 +1747,18 @@ guess_category_value (const gchar *category_name)
   if ((retval != NULL) && (retval[0] != '\0'))
     return retval;
 
+#ifdef G_PLATFORM_WIN32
+  /* g_win32_getlocale() first checks for LC_ALL, LC_MESSAGES and
+   * LANG, which we already did above. Oh well. The main point of
+   * calling g_win32_getlocale() is to get the thread's locale as used
+   * by Windows and the Microsoft C runtime (in the "English_United
+   * States" format) translated into the Unixish format.
+   */
+  retval = g_win32_getlocale ();
+  if ((retval != NULL) && (retval[0] != '\0'))
+    return retval;
+#endif  
+
   return NULL;
 }