From: Tor Lillqvist Date: Wed, 8 Sep 2004 22:44:22 +0000 (+0000) Subject: On Win32, as last resort call g_win32_getlocale() to get the current X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=cbadee081213a5d80f790b75333926c493bb152d;p=dana%2Fcg-glib.git On Win32, as last resort call g_win32_getlocale() to get the current 2004-09-08 Tor Lillqvist * 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. --- diff --git a/ChangeLog b/ChangeLog index e4a470ce..1afdcd73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-09-08 Tor Lillqvist + + * 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 * glib/gutils.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e4a470ce..1afdcd73 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2004-09-08 Tor Lillqvist + + * 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 * glib/gutils.h: diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index e4a470ce..1afdcd73 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +2004-09-08 Tor Lillqvist + + * 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 * glib/gutils.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e4a470ce..1afdcd73 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2004-09-08 Tor Lillqvist + + * 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 * glib/gutils.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e4a470ce..1afdcd73 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2004-09-08 Tor Lillqvist + + * 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 * glib/gutils.h: diff --git a/glib/glib.def b/glib/glib.def index f2639f97..6c9abced 100644 --- a/glib/glib.def +++ b/glib/glib.def @@ -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 diff --git a/glib/gutils.c b/glib/gutils.c index 2afa8d22..c2fdf463 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -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; }