Monday, December 29, 2008

How to change default locale (Ubuntu GNOME)

  I have always been a fan of English as my main language while using the computer or computer-related terminology. Recently I've stumbled upon the screenlets package (see picture or install debian package).
The only problem is that using United States' default date is shown as Month/Date/Year (i.e. 29/12/2008), which is rather unattractive (hey - my eyes, my brain, my opinion, my choice!).
  After many unsuccessful tries of various commands, I've come up with a rather graphical-based solution to use the locale I preferred. Obviously, the best choice for me would be en_GB (Great Britain/United Kingdom), since I wanted to stick with English, but use the date format Date/Month/Year.
  1. System > Admnistration > Language Support
Or you can simply run the command: gnome-language-selector
  2. Type in your password if asked to do so. (Make sure you're the adminsitrator, it might involve installing extra packages)
  3. Install your language of preference.
  4. Choose the language of your choice again as the "Default language".
  5. Press "Apply" and click "OK".
  6. Log out (System > Log out).
  7. While viewing the Login screen, click "Options" (lower left corner in Ubuntu), then "Set Language" and select "System Default". It will ask you to restart the login screen (press "Yes").
  8. When the login screen is restarted, you will be using the language of your preference with the appropriate locale! :) You should be able to check this out when you run the following command in Terminal (Applications > Accessories > Terminal):
locale

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=


Now, if you notice any problems:
1. Execute these commands in terminal:
sudo -s

echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"' > /etc/environment

2. Reboot your computer.
3. Run the gnome language selector again, choose "English (United States)" (or whatever was the default language). Press Apply and OK. Run it once more and set it again to the language you want it to be ("English (United Kingdom)"), press Apply and OK.
4. Follow the steps 6, 7 and 8 above.
You ought to be able to have the default language and locale you selected!

1 comment:

Anonymous said...

REALITY = GLOBALITY

I want to use english language
My location is Spain
I want the week to start on Monday (like in many countries)
But I want the currency in european EUR.
and the thousabd,s delimiter to be the american one, not the spanish one.
I want to write mails and comments with spelling correction for three different languages

THINK GLOBALLY, ACT LOCALLY