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:
Christian Stimming
2002-07-03 22:21:02 +00:00
parent 7c85fa2b35
commit f6e2119afa
2 changed files with 22 additions and 13 deletions

View File

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

View File

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