Re: gnome_i18n_get_language_list -> g_i18n_get_language_list

Owen Taylor <> writes:

> First, I have an I'm a bit hesitant about the fact that it 
> uses the environment rather than setlocale() to determine the
> language list. 

Well, actually I have no idea what exactly this function
(gnome_i18n_get_language_list) is good for, I just want to have it
out of gnome-libs ...

So someone with a clue should try to make up his mind about this ...

> Second, the are some formatting problems with the patch,
> mostly from missing spaces.

Should all be fixed now.

> glib is reentrant, so you need to avoid strtok. Since strtok_r
> isn't sufficiently portable, you'll probably want to recode
> in some other fashion.

Ok, rewritten as some for(..) loop.

> > /*return the un-aliased language as a newly allocated string*/
> > static char *
> > unalias_lang (char *lang)
> Comment about 'newly allocated' has no relation to reality.

Removed that comment.

> >       read_aliases ("/usr/share/locale/locale.alias");
> >       read_aliases ("/usr/local/share/locale/locale.alias");
> >       read_aliases ("/usr/lib/X11/locale/locale.alias");
> >       read_aliases ("/usr/openwin/lib/locale/locale.alias");
> I'm not so crazy about this indiscriminant reading of locale
> alias files. If the alias isn't in the system locale alias
> database, then it really doens't make much sense to honor
> it.


> > const GList *
> > g_i18n_get_language_list (const gchar *category_name)
> 'const GList *' just doesn't make sense. ->next would
> be non-constant. 

Well, currently most code which uses this function seems to be
calling g_list_reverse (g_list_copy ()) on the returned list, so
what about returning a non-constant copy of the list ?

Updated gi18n.c

Martin Baulig (private) (work)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]