Comment 11 for bug 663776

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote : Re: Search dialog can not support iBus

Hello Kyle,

After a number of changes in Ubuntu, LANG is no longer intended for
controlling which language is used for translation of messages in menus
and windows. The changes were made in order to prevent confusion when
users want to apply different locales for message translation
respective other format stuff like dates and numbers.

The language(s) you pick in language-selector's "Language" tab sets the
LANGUAGE and LC_MESSAGES variables, and the underlying assumption is
that applications use either $LANGUAGE or $LC_MESSAGES to determine the
translation language.

Accordingly, if an application uses the $LANG value _directly_ to
determine the translation language, there will be problems if $LANG does
not happen to equal $LC_MESSAGES.

Kyle Nitzsche wrote:
> The correction may be to let iBus use the LANGUAGE env var instead of
> LANG to determine the current locale.

Maybe. The first item in the $LANGUAGE list is not a complete locale
name, though. If it is the locale you are after, you'd better use the
LC_MESSAGES variable.

> (Indeed all apps that use LANG should transition to LANGUAGE or they
> too may suffer locale confusion.)

Hopefully there are not that many of them. To prevent locale confusion,
transition to LC_MESSAGES will do. But it's even better if they are
changed to understand the LANGUAGE priority list, so that non-English
fall back language(s) are recognized.

> The result is that unity-2d Search box (and elsewhere) supports iBus
> through the UI, as follows:
>
> In Language Support:
> * Tab 1: Install Chinese/Simplified translations, input methods, and
> fonts
> * Tab 1: Apply System-Wide button
> * Tab 1: Select iBus in Keyboard Input Method System combo.
> * Tab2 (named "Regional Formats" in en _US"): Select Chinese and
> Apply.
> * Reboot/Relogin
> * Ctrl + Space enables /disables iBus

I saw that you changed the bug status to "Invalid", but to me a need to
set LANG to make iBus work does not seem to be satisfying. If iBus
grabs $LANG directly, I believe it ought to be changed to grab
$LC_MESSAGES instead. Therefore I changed the status to "Confirmed".

> Enabling input methods also seems somewhat hidden since it occurs on
> Region Formats tab, whose text discusses Number, Date and Currency
> formats but that does not mention input methods.

It occurs on the "Language" tab, and there is a tooltip that comments on
input methods. The latter is true as from version 0.25 of
language-selector.

HTH