Ubuntu – How to change the language order by command-line (or text editor)

languagelocale

How can I change the language order by command-line (or text editor)? i.e. without using the graphical "gnome-language-selector".

(Or is there a better GUI which allows you to select multiple language entries and move them all to another position directly, without having to do it one by one?)

Alternatively: Where are the user-specific language settings stored? i.e. the /etc/default/locale for users.

Best Answer

List installed locales

locale -a

List current settings

locale

Changing settings temporarily

Any environment variable may be set on the command line for the current process:

$ date
Sat May 14 15:59:12 CEST 2011

$ LC_TIME=zh_CN.UTF-8 

$ date
2011年 05月 14日 星期六 16:00:13 CEST 2011

Changing settings permanently

If you want more fine-grained control, you may manually change your system's locale entries by modifying the file /etc/default/locale.

For example on a German system, to prevent system messages from being translated, you may use:

LANG=de_DE.UTF-8
LC_MESSAGES=POSIX

Note: changes take effect only after a fresh login.

For Additional Hhelp