Commit 7684b181 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

use g_get_language_names().

2005-02-28  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimphelp.c (gimp_help_get_locales): use
	g_get_language_names().

	* plug-ins/help/locales.c (locales_parse): simplified;
	g_get_language_names() already takes care of this.
parent ca356064
2005-02-28 Sven Neumann <sven@gimp.org>
* app/widgets/gimphelp.c (gimp_help_get_locales): use
g_get_language_names().
* plug-ins/help/locales.c (locales_parse): simplified;
g_get_language_names() already takes care of this.
2005-02-27 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c: allow to change ellipsation
mode after the combo has been created.
2005-02-27 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_menu.c (menu_build_mru_items): another
......
......@@ -331,24 +331,9 @@ gimp_help_call (Gimp *gimp,
static gchar *
gimp_help_get_locales (GimpGuiConfig *config)
{
const gchar *language;
gchar *locale;
if (config->help_locales && strlen (config->help_locales))
return g_strdup (config->help_locales);
locale = gimp_get_default_language ("LC_MESSAGES");
/* Simulate the behaviour of GNU gettext() and look
* at LANGUAGE if the locale is not the "C" locale.
*/
language = g_getenv ("LANGUAGE");
if (language && (locale == NULL || strcmp (locale, "C")))
{
g_free (locale);
locale = g_strdup (language);
}
return locale;
return g_strjoinv (":", g_get_language_names ());
}
......@@ -34,10 +34,10 @@
GList *
locales_parse (const gchar *help_locales)
{
GList *locales = NULL;
GList *list;
const gchar *s;
const gchar *p;
GList *locales = NULL;
GList *list;
const gchar *s;
const gchar *p;
g_return_val_if_fail (help_locales != NULL, NULL);
......@@ -54,28 +54,6 @@ locales_parse (const gchar *help_locales)
if (*s)
locales = g_list_append (locales, g_strdup (s));
/* add locales w/o variants unless they exist already */
for (list = locales; list; list = list->next)
{
s = (const gchar *) list->data;
p = strchr (s, '_');
if (p)
{
GList *iter;
gchar *new = g_strndup (s, p - s);
for (iter = locales; iter; iter = iter->next)
if (strcmp ((const gchar *) iter->data, new) == 0)
break;
if (iter)
g_free (new);
else
locales = g_list_append (locales, new);
}
}
/* if the list doesn't contain the default domain yet, append it */
for (list = locales; list; list = list->next)
if (strcmp ((const gchar *) list->data, GIMP_HELP_DEFAULT_LOCALE) == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment