Comment 22 for bug 23435

Revision history for this message
Michael Terry (mterry) wrote : Re: Can't select Esperanto language in gnome

So I don't see either of the fixes that Martin did on my Intrepid machine. GDM's locale.conf doesn't use eo_XX and langpack-locales still calls the locale 'eo'. So I'm not sure what's up with that.

However, I believe the real problem lies in belocs-locales-bin:

When installing a language-pack-XX-base package, the program 'install-language-pack' is called with the language code during postinst. The expectation is that this will generate all UTF-8 locales for that language on the system. This occurs by in turn calling locale-gen and expecting it to fallback to its 'guess that the user wants all locales' algorithm if it can't find the exact specified locale in /usr/share/i18n/SUPPORTED.

However, the language eo has a locale in /usr/share/i18n/SUPPORTED called just 'eo'. So locale-gen thinks that the caller wants that specific locale and never uses its 'install all locales for the language' fallback logic.

Even if it did use that logic, the code assumes that there is a country code for all UTF-8 locales. This might not be the case, as eo shows (there is a 'eo.UTF-8' locale).

Attached is a debdiff for jaunty that modifies locale-gen to add a new argument --lang that tells it that the passed argument is really a language code, not a specific locale that we want generated. This part is needed to bypass the exact match of 'eo'.

Then, I also modified locale-gen to use a slightly more clever 'find all UTF-8 locales' algorithm that anticipates locales without country codes (like eo.UTF-8 and any other such).

I added the --lang option to the install-language-pack script and modified remove-language-pack to support deleting locales that don't have country codes.