diff options
author | Dan Winship <danw@src.gnome.org> | 2002-11-27 01:20:16 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2002-11-27 01:20:16 +0800 |
commit | 57d76d9b31a0ff48f2134d11737818a74fdf6c8a (patch) | |
tree | 30ce4e2e175397fcf9de1a87add71f94f20c244b /e-util/e-lang-utils.c | |
parent | 2382dbef3f62323796e1b36996bd14a74230a024 (diff) | |
download | gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.gz gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.zst gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.zip |
If the language is something like "fr_FR", return both "fr_FR" and "fr" in
* e-lang-utils.c (e_get_language_list): If the language is
something like "fr_FR", return both "fr_FR" and "fr" in the list.
Oaf doesn't consider "fr_FR" to match a "-fr" translation.
svn path=/trunk/; revision=18926
Diffstat (limited to 'e-util/e-lang-utils.c')
-rw-r--r-- | e-util/e-lang-utils.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/e-util/e-lang-utils.c b/e-util/e-lang-utils.c index 3516531eb3..649a8cc887 100644 --- a/e-util/e-lang-utils.c +++ b/e-util/e-lang-utils.c @@ -32,8 +32,10 @@ GSList * e_get_language_list (void) { + GSList *list = NULL; const char *env; const char *p; + char *lang; env = g_getenv ("LANGUAGE"); if (env == NULL) { @@ -44,15 +46,24 @@ e_get_language_list (void) p = strchr (env, '='); if (p != NULL) - return g_slist_prepend (NULL, (void *) (p + 1)); - else - return g_slist_prepend (NULL, (void *) env); + env = p; + + list = g_slist_prepend (list, g_strdup (env)); + + p = strchr (env, '_'); + if (p != NULL) + list = g_slist_prepend (list, g_strndup (env, p - env)); + + return list; } void e_free_language_list (GSList *list) { - g_return_if_fail (list != NULL); + GSList *iter; + + for (iter = list; iter; iter = iter->next) + g_free (iter->data); g_slist_free (list); } |