Locale settings

Leo Cacciari leo.cacciari at gmail.com
Wed Mar 12 11:21:40 UTC 2008

Il giorno mer, 12/03/2008 alle 10.49 +0100, August Karlstrom ha scritto:
> Hello everyone,
> What I would like to have is a swedish locale but with messages in english.
> I probably need something like
> export LANG="sv_SE.UTF-8"
> export LC_MESSAGES="en_US.UTF-8"
> but to which file do I add these lines? I also want the settings to take effect
> only for a local user.
> Regards,
> August
  Each interactive login shell execute commands in ~/.profile. Adding
the commands there would do the trick. 

As these variables can be set multiple time with no bad effect (as it
would be the case when adding something to PATH, for instance) you could
also add them to .bashrc 

Be careful that this only works in _interactive_ shells, i.e. those in a
terminal. When you start a shell for executing a script, these files are
not read. Obviously, if you start the script yourself during a session,
these variables values would still be in the environment because they
are exported. But if your user start a script in other way (e.g. through
a call to 'at' or inserting it in a cron table) he/she would not have
the language variables set as expected, because the files would not be

To avoid this, the user should either put the variables in the script or
have the script source the file containing the definitions.

Leo 'TheHobbit' Cacciari

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa ? una parte del messaggio	firmata digitalmente
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080312/58285f4c/attachment.pgp>

More information about the ubuntu-users mailing list