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 | |
parent | 2382dbef3f62323796e1b36996bd14a74230a024 (diff) | |
download | gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.gz gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.bz2 gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.lz gsoc2013-evolution-57d76d9b31a0ff48f2134d11737818a74fdf6c8a.tar.xz 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
-rw-r--r-- | e-util/ChangeLog | 6 | ||||
-rw-r--r-- | e-util/e-lang-utils.c | 19 |
2 files changed, 21 insertions, 4 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index ec03e75cbb..97f643ad23 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2002-11-26 Dan Winship <danw@ximian.com> + + * 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. + 2002-11-22 Not Zed <NotZed@Ximian.com> * e-msgport.c (EMsgPort): Added an optional nspr pipe field. 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); } |