diff options
Diffstat (limited to 'e-util')
-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); } |