On Win32, as last resort call g_win32_getlocale() to get the current

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.
This commit is contained in:
Tor Lillqvist
2004-09-08 22:44:22 +00:00
committed by Tor Lillqvist
parent d209e108b1
commit cbadee0812
7 changed files with 58 additions and 0 deletions

View 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;
}