2001-06-07 Dave Peticolas <dave@krondo.com>

* src/gnome/new-user-callbacks.c (gnc_get_ea_locale_dir): if first
	check fails, see if 2-letter prefix succeeds


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4522 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-06-07 21:56:17 +00:00
parent f942b6f55e
commit c7b56080a9
2 changed files with 19 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
2001-06-07 Dave Peticolas <dave@krondo.com>
* src/gnome/new-user-callbacks.c (gnc_get_ea_locale_dir): if first
check fails, see if 2-letter prefix succeeds
2001-06-07 James LewisMoss <jimdres@mindspring.com>
* doc/README.translator.txt (variables): add instructions for

View File

@@ -202,21 +202,32 @@ gnc_get_ea_locale_dir(const char *top_dir)
gchar *ret;
gchar *locale;
struct stat buf;
locale = g_strdup(setlocale(LC_MESSAGES, NULL));
ret = g_strdup_printf("%s/%s", top_dir, locale);
g_free(locale);
printf("Pondering dir: %s\n", ret);
if(stat(ret, &buf) != 0 && (strlen (locale) > 2))
{
g_free (ret);
locale[2] = '\0';
ret = g_strdup_printf("%s/%s", top_dir, locale);
}
printf("Pondering dir: %s\n", ret);
if(stat(ret, &buf) != 0)
{
g_free (ret);
ret = g_strdup_printf("%s/%s", top_dir, default_locale);
}
printf("Opening from dir: %s\n", ret);
g_free(locale);
return ret;
}