Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/eglib
diff options
context:
space:
mode:
authorAxlPr <alexprentl@gmail.com>2013-11-12 13:31:11 +0400
committerAxlPr <alexprentl@gmail.com>2013-11-12 13:31:11 +0400
commit2e579c47fb6d7e31ebaa6c3df007764f79d97968 (patch)
tree7d4d0483fdba03345daaa34bae8670fbab3e9dc8 /eglib
parentb5bc9d75d52ea01ecb3ae6253554ca063806bd46 (diff)
Fixed g_win32_getlocale
Implemented g_win32_getlocale function to return correct locale.
Diffstat (limited to 'eglib')
-rw-r--r--eglib/src/gmisc-win32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/eglib/src/gmisc-win32.c b/eglib/src/gmisc-win32.c
index 07dcf39aec8..f89f37c2204 100644
--- a/eglib/src/gmisc-win32.c
+++ b/eglib/src/gmisc-win32.c
@@ -87,10 +87,12 @@ g_unsetenv(const gchar *variable)
gchar*
g_win32_getlocale(void)
{
- /* FIXME: Use GetThreadLocale
- * and convert LCID to standard
- * string form, "en_US" */
- return strdup ("en_US");
+ LCID lcid = GetThreadLocale();
+ gchar buf[19];
+ gint ccBuf = GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buf, 9);
+ buf[ccBuf - 1] = '-';
+ ccBuf += GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
+ return strdup(buf);
}
gboolean