Comment 12 for bug 1440275

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@Tim,

I noticed a similar problem at Ask Ubuntu:
http://askubuntu.com/questions/616688

So I had a look, and I think the problem lies in two Ubuntu patches, so it hasn't likely been fixed upstream.

* gnome-desktop3, ubuntu_language.patch
* gnome-control-center, 52_region_language.patch

ubuntu_language.patch adds the collect_locales_from_ubuntu() function to gnome-languages.c. collect_locales_from_ubuntu() is called from collect_locales() and populates the hash table gnome_available_locales_map via the add_locale() function.

Since the function cc_common_language_get_initial_regions() in gnome-control-center calls gnome_get_all_locales() in gnome-languages.c, which in turn uses the gnome_available_locales_map hash table, it incorrectly grabs the list of languages.

Originally (in 3.6) the call for /usr/share/language-tools/language-options happened directly in the function which populated the list of available languages. To achieve something similar, this could be done:

- Drop the addition of collect_locales_from_ubuntu() and the changes to
  collect_locales() from ubuntu_language.patch

- Let cc_common_language_add_user_languages() call
  /usr/share/language-tools/language-options directly somehow (via
  52_region_language.patch)

Another approach might be to replace the use of gnome_get_all_locales() in cc_common_language_get_initial_regions() with a 'locale -a' list.