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
zzzoldfeatures/gda-dev
Christian Stimming 20 years ago
parent c7172736dd
commit 8ba8f89376

@ -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);

Loading…
Cancel
Save