mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-07-03 Christian Stimming <stimming@tuhh.de>
* src/gnome/druid-hierarchy.c (gnc_get_ea_locale_dir): If current locale doesn't work for account hierarchy druid, then check all abbreviated versions of that locale. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7079 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2002-07-03 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/gnome/druid-hierarchy.c (gnc_get_ea_locale_dir): If current
|
||||
locale doesn't work for account hierarchy druid, then check all
|
||||
abbreviated versions of that locale.
|
||||
|
||||
2002-07-02 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* register/register-gnome/gnucash-sheet.c: allow a caller to
|
||||
|
||||
@@ -311,7 +311,8 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
||||
gchar *ret;
|
||||
gchar *locale;
|
||||
struct stat buf;
|
||||
|
||||
int i;
|
||||
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
locale = g_strdup(setlocale(LC_MESSAGES, NULL));
|
||||
#else
|
||||
@@ -323,21 +324,23 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
||||
setlocale(LC_ALL, NULL) : "C");
|
||||
#endif
|
||||
|
||||
i = strlen(locale);
|
||||
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
||||
|
||||
if(stat(ret, &buf) != 0 && (strlen (locale) > 2))
|
||||
{
|
||||
g_free (ret);
|
||||
locale[2] = '\0';
|
||||
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
||||
while (stat(ret, &buf) != 0)
|
||||
{
|
||||
i--;
|
||||
if (i<1)
|
||||
{
|
||||
g_free(ret);
|
||||
ret = g_strdup_printf("%s/%s", top_dir, default_locale);
|
||||
break;
|
||||
}
|
||||
locale[i] = '\0';
|
||||
g_free(ret);
|
||||
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
||||
}
|
||||
|
||||
if(stat(ret, &buf) != 0)
|
||||
{
|
||||
g_free (ret);
|
||||
ret = g_strdup_printf("%s/%s", top_dir, default_locale);
|
||||
}
|
||||
|
||||
|
||||
g_free(locale);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user