Setting locale for individual programs

Dotan Cohen dotancohen at gmail.com
Tue Jul 11 21:52:46 UTC 2006


On 11/07/06, Dariusz J. Garbowski <thuforuk at yahoo.co.uk> wrote:
> Say I wanted to run "ls -l" with Polish locale. I'd type in shell (bash):
>
> LC_ALL=pl_PL  ls -l
>
> This will run ls with pl_PL locale. What happens is that LC_ALL
> environment variable is set for the next command.

Yes, only for the next command. I didn't realize that at first, so I
was wary of using it.

> You can find more on other locale related variables in "man bash"
> (search for LC_ALL). This way you can have fine grained control of
> locale environment, e.g. have numbers displayed in one locale
> (LC_NUMERIC), messages in another (LC_MESSAGES), etc. Note: bash manual
> is not complete when it comes to LC_ variables -- search google for
> more! LC_ALL will do if you want everything to be in one locale (which
> is typically what people usually want).

LC_ALL is what I'm setting. Though I may micro-manage it in the future.

> You can make an alias and have your selected applications always run
> with specific locale (when run from bash). Edit ~/.bashrc and add
> something like this:
>
> alias make='LC_ALL=en_US make'
>
> Open new terminal to try 'make' -- it should be in English from now on :-)

Excellent! That's much better than creating shellscripts for each program.

> Note: .bashrc will change locale for apps run from command line only, so
> if you run them from some GUI, or K-menu/panel/etc. you might need to
> modify other places, liked desktop entries or configuration of your IDE.

Hm, this seems to be my problem. When I do type firefox at the command
line, I get my 'modified' firefox. But the KDE menu still gives me the
standard Fx. I've been able to figure out by googleing the topic that
for gnome I would modify .gnomerc, but I can't seem to locate the KDE
equivelent. But at least now I have a slight clue.

> Have fun!

I am! I'm really finetuning this system, and feel for the first time
that this is 'my' computer- set up how I like it, not how Bill or
Linus or any scampering little gnome likes it. Until now, I didn't
know that operating a computer could be comfortable and fun.

Dotan Cohen
http://gmail-com.com




More information about the kubuntu-users mailing list