From 8ba8f893761d2a89ae170e08b39ae3413b53418b Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Mon, 6 Nov 2006 15:27:42 +0000 Subject: [PATCH] Add win32 method for looking up the current LANG string git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15089 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/druid-hierarchy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gnome/druid-hierarchy.c b/src/gnome/druid-hierarchy.c index df9017383f..e3c911c776 100644 --- a/src/gnome/druid-hierarchy.c +++ b/src/gnome/druid-hierarchy.c @@ -185,12 +185,18 @@ gnc_get_ea_locale_dir(const char *top_dir) #ifdef HAVE_LC_MESSAGES locale = g_strdup(setlocale(LC_MESSAGES, NULL)); #else +# ifdef G_OS_WIN32 + /* On win32, setlocale() doesn't say anything useful. Use + glib's function instead. */ + locale = g_strdup( *g_get_language_names() ); +# else /* * Mac OS X 10.1 and earlier, not only doesn't have LC_MESSAGES * setlocale can sometimes return NULL instead of "C" */ locale = g_strdup(setlocale(LC_ALL, NULL) ? setlocale(LC_ALL, NULL) : "C"); +# endif #endif i = strlen(locale);