LanguageSelector

Summary

  1. UI changes:
    • Users will be able to specify which fallback languages they want to use in case their applications are not fully translated into their main language.
    • Users will be able to manipulate the LANG and LANGUAGES locale specific environment variables separately through the GUI.
    • Ability to choose "@ locales" - e.g. sr@latin
    • software-center/aptdaemon: pull language specific packages when main application package is going to be installed

Release Note

The Gnome version of language-selector now supports to set the values for the LANG and LANGUAGE environment variables separately. The LANG variable reflects settings, like date and time format, currency, number format, paper format, etc., while the LANGUAGE variable defines in which language the applications and the desktop are displayed. The LANG variable takes exactly one locale code, e.g. en_US.UTF-8. The LANGUAGE variable can contain multiple language codes, separated by ':', e.g. de_DE:de:en_GB:en. When the translations for the first language code are not available, the next language code in the list is tried.

The Gnome version of language-selector copies the functionality of KDE, by providing a user interface to manipulate the LANG and LANGUAGE settings. The settings get stored in the ~/.profile file in the user's home directory. If the user is a member of the admin group, the user's settings can be applied system wide with a click on a button.

Explanationary tooltips are available to guide users to make the right choices.

Caveats:

  • As of Alpha3, gdm does not support the values being set in ~/.profile yet and hence will override those settings at login time. This should be fixed by beta-I.
  • For some languages there appear to be duplicate entries in the Language list, although they are not. The underlying language codes are different. This needs to be reflected better in the UI.

Rationale

  1. UI changes:
    • The list of fallback languages is currently configured in a config file in language-selector. This configuration provides some sane default fallback settings for a number of languages. Since those settings might not satisfy every user, we should provide an easy to use interface to change it. KDE and Firefox contain this possibility already. Some users prefer to use their desktop in a different language than which is spoken in their country of residence. E.g. a user might live in Thailand, but prefers to use his desktop in English. Since the main English locale (en_US) uses the imperial system, but the user prefers to use system used in his country of residence, it would be useful to have a GUI to set this information. The information then gets stored in the locale specific environment variables (e.g. LANG=th_TH and LANGUAGE=en_US).
  2. pull language specific packages when main application package gets installed:
    • Currently the user needs to run language-selector manually when he installed a package which has additional localisation packages (e.g. mozilla applications, oo.o). Language-selector will then check for the installed locales and mark the additional packages for installation. This step should be done by software-center/aptdaemon already.

Design

language-selector-lucid.jpg

  • Language settings:
    • system settings, like measurements, paper format, currency, etc. are set with the LANG variable (also sets the default language)
    • if the user wants his desktop in a different language, set LANGUAGE to his preferred language(s). This overrides the setting in LANG, but only for the desktop language. Everything else stays the same.
    • Fallback language settings get set in LANGUAGE, separated by colon.
    • Measurement setting basically depends on the country of residence, only one choice, no fallbacks.
    • The treeview for selecting the preferred languages, will set LANGUAGE.

Implementation

  1. environment variable settings
    • system wide settings go in /etc/default/locale
    • user specific settings go in ~/.profile
    • LANGUAGE (= Default language and Fallback languages, separated by colon)
    • LANG (= System settings, depending on the country of residence)
  2. pull language specific packages when main application package gets installed
    • improve check-language-support function in language-selector to support package wise queries
    • add feature in software-center and aptdaemon to call this function, parse the output and mark the additional packages for install (mvo)

Test/Demo Plan

  1. Language tab
    • The language treeview should list all locally available languages with country names where applicable.
      • This list corresponds to the generated locales (locale -a), minus 'C' and 'POSIX', plus a generic language entry as fall back (e.g. you would see all the English variants, plus a generic "English" entry).
      • Each entry is supposed to be translated into the native language, i.e. entries for German appear as "Deutsch", entries for Chinese appear as "汉语", etc.
      • All language entries below "English" appear in Grey and are "disabled", means they won't be used for translations.
      • The entries can be sorted by drag and drop
      • When modifying the sort order, a new value for the LANGUAGE variable gets computed and written to ~/.profile instantly.
      • When clicking the 'Apply System-Wide...' button, it will ask for the user's password and then write the LANGUAGE setting to /etc/default/locale and /etc/environment. The button will be disabled if the user is not a member of the admin group.
  2. Text tab
    • The combobox lists all generated locales on the system, minus 'C' and 'POSIX'. The list is taken from 'locale -a'.
      • Each entry is supposed to be translated into the native language, i.e. entries for German appear as "Deutsch", entries for Chinese appear as "汉语", etc.
      • When changing the selection in the combobox, the LANG value will be updated in ~/.profile instantly. Also, the 'Example' Box will be updated and show example values according to the selected locale.
      • When clicking the 'Apply System-Wide...' button, it will ask for the user's password and then write the LANG setting to /etc/default/locale and /etc/environment. The button will be disabled if the user is not a member of the admin group.

Unresolved Issues

  1. Design issues:
    • Should install/remove language be just a selectable "add more" or "Add" + "Remove" besides the lists above, instead of a popping up window which has checkboxes? Removing would work by simply selecting and removing, adding would require new window (or sidepanel) but no need for additional checkboxes.
    • List of install/remove languages is a bit unusable because of the longness of it - any solutions?
    • AP: Consult design again. One thing relatively clear is that already installed languages should be grouped together / shown clearly

installed-languages.jpg

  • Administrate button which opens a separate window with Admin only tasks. Then split language-selector and have two menu entries, one in Preferences, one in Administration - ask Design team for input


CategorySpec

DesktopTeam/Specs/Lucid/LanguageSelector (last edited 2010-02-24 21:34:59 by www)