On Win32, look explicitly for LANG, LC_ALL and LC_CTYPE, and if not found,
2002-09-20 Tor Lillqvist <tml@iki.fi> * gtk/gtkmain.c (gtk_get_default_language): On Win32, look explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use g_win32_getlocale(). The setlocale() in msvcrt.dll would return a locale name in the form Swedish_Finland for sv_FI.
This commit is contained in:
parent
d8a4962708
commit
8a4c5247b3
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
2002-09-20 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gtk/gtkmain.c (gtk_get_default_language): On Win32, look
|
||||||
|
explicitly for LANG, LC_ALL and LC_CTYPE, and if not found, use
|
||||||
|
g_win32_getlocale(). The setlocale() in msvcrt.dll would return a
|
||||||
|
locale name in the form Swedish_Finland for sv_FI.
|
||||||
|
|
||||||
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
* gdk/gdkfont.h: Delete leftover declarations of the obsolete
|
||||||
Win32-only functions gdk_font_full_name_get() and
|
Win32-only functions gdk_font_full_name_get() and
|
||||||
gdk_font_full_name_free().
|
gdk_font_full_name_free().
|
||||||
|
@ -1032,7 +1032,37 @@ gtk_get_default_language (void)
|
|||||||
PangoLanguage *result;
|
PangoLanguage *result;
|
||||||
gchar *p;
|
gchar *p;
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
/* Somebody might try to set the locale for this process using the
|
||||||
|
* LANG or LC_ environment variables. The Microsoft C library
|
||||||
|
* doesn't know anything about them. You set the locale in the
|
||||||
|
* Control Panel. Setting these env vars won't have any affect on
|
||||||
|
* locale-dependent C library functions like ctime. But just for
|
||||||
|
* kicks, do obey LC_ALL, LANG and LC_CTYPE in GTK. (This also makes
|
||||||
|
* it easier to test GTK and Pango in various default languages, you
|
||||||
|
* don't have to clickety-click in the Control Panel, you can simply
|
||||||
|
* start the program with LC_ALL=something on the command line.)
|
||||||
|
*/
|
||||||
|
p = getenv ("LC_ALL");
|
||||||
|
if (p != NULL)
|
||||||
|
lang = g_strdup (p);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = getenv ("LANG");
|
||||||
|
if (p != NULL)
|
||||||
|
lang = g_strdup (p);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = getenv ("LC_CTYPE");
|
||||||
|
if (p != NULL)
|
||||||
|
lang = g_strdup (p);
|
||||||
|
else
|
||||||
|
lang = g_win32_getlocale ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
lang = g_strdup (setlocale (LC_CTYPE, NULL));
|
lang = g_strdup (setlocale (LC_CTYPE, NULL));
|
||||||
|
#endif
|
||||||
p = strchr (lang, '.');
|
p = strchr (lang, '.');
|
||||||
if (p)
|
if (p)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user