Difference between revisions of "Locale"

From ArchWiki
Jump to navigation Jump to search
(finally mentioned rc.conf, no more "not arch-specific" tips please)
Line 1: Line 1:
Configuring (adding and removing) locales is a breeze. As super user, edit <code>/etc/locale.gen</code>, uncommenting (removing "#" from the beginnings of appropriate lines) the locales you require. Then, run <code>locale-gen</code>. If you now run <code>locale -a</code>, you should see whatever those you have specified.
+
Configuring (adding and removing) locales is a breeze. As super user, edit <code>/etc/locale.gen</code>, uncommenting (removing "#" from the beginning of appropriate lines) the locales you require. Then, run <code>locale-gen</code>. If you now run <code>locale -a</code>, you should see the locales you have specified.
  
For your locale to come into effect, you must set an environmental variable. The easiest way to do this is by editing the <code>.bashrc</code> file in your home directory. Add the following line to this file:
+
For your locale to come into effect, you must set it in <tt>/etc/rc.conf</tt>. Pick the desired locale from your earlier <tt>locale -a</tt> output and edit the default setting of
export LC_ALL="locale"
+
  LOCALE="en_US.utf8"
For instance,
 
  export LC_ALL="he_IL.utf8"
 
When you next start bash (upon reboot, for instance), the LC_ALL environmental variable will be set for you.
 
  
Configuring a proper locale can greatly enhance your Linux experience. For instance, configuring a Hebrew locale will allow you to read Hebrew messages in Gaim.
 
  
'''WARNING: Changing your locale to this will not grant you powers to read Hebrew!'''
+
This is a system-wide setting, so if you have multiple users on your machine, they might prefer to set their own locale in a login script, for example <tt>.bashrc</tt>. Just add
 +
export LANG="de_DE@euro"
 +
... for example.
 +
 
  
 
[[Category:Internationalisation]]
 
[[Category:Internationalisation]]

Revision as of 02:06, 14 October 2006

Configuring (adding and removing) locales is a breeze. As super user, edit /etc/locale.gen, uncommenting (removing "#" from the beginning of appropriate lines) the locales you require. Then, run locale-gen. If you now run locale -a, you should see the locales you have specified.

For your locale to come into effect, you must set it in /etc/rc.conf. Pick the desired locale from your earlier locale -a output and edit the default setting of

LOCALE="en_US.utf8"


This is a system-wide setting, so if you have multiple users on your machine, they might prefer to set their own locale in a login script, for example .bashrc. Just add

export LANG="de_DE@euro"

... for example.