Konsole in English
James Tyrer
jrtyrer at earthlink.net
Tue Oct 27 02:34:20 GMT 2009
Ryo Furue wrote:
> James and Dotan,
>
> | > Which file is that? I know that it is probably .profile or
> | > .bash_profile but I cannot test because this is a work machine. I need
> | > to know which file _only_ affects Konsole and other terminal
> | > emulators, but WILL NOT affect other KDE and non-KDE GUI applications
> | >
> | You are correct that this won't work.
> |
> | First, it isn't really correct to change the environment in the
> | ".bashrc" file.
>
> I don't see why. Remember Dotan's requirements. The menus of
> konsole should be in a different language; the command lines should
> be in English. .bashrc is a very good place to achieve that.
>
> | The environment should be changed with the
> | ".bash_profile" script.
>
> If you want them to be effective everywhere, yes.
> But, if you want them to be effective only on the command line of bash
> (and its children), then .bashrc is the place. This is one of the
> reasons why we have two files, .bashrc and .bash_profile,
> in the first place.
>
> Suppose that we export LANG=C in .bashrc . There is one problem
> remaining. Env. vars. are inherited by children. So, if you
> invoke konsole from the command line, like so,
>
> $ konsole &
>
> then it sees LANG=C and its menus will be in English.
>
> To comprehensively solve this problem, you might want to
> always invoke konsole as
>
> $ LANG=your_native_language konsole
>
> or
>
> $ env LANG=your_native_language konsole
>
> To make this automatic, you can edit your konsole.desktop file and replace
>
> Exec=konsole
>
> with
>
> Exec=env LANG=your_native_language konsole
>
You appear to have snipped out:
"Second, if you do so (either way), it will affect the whole KDE session
for that user."
That is why it won't work (or might not work). But, it doesn't explain
why that is (or might be) true.
If you read the 'Fine Man Page',
"When bash is invoked as an interactive login shell, or as a
non-interactive shell with the --login option, it first reads and
executes commands from the file /etc/profile, if that file exists. After
reading that file, it looks for ~/.bash_profile, ~/.bash_login, and
~/.profile, in that order, and reads and executes commands from the
first one that exists and is readable."
"When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists."
You would think that it should work. However, it is also common
practice for ".bash_profile" to change that.
Fedora 10 "/etc/skel/.bash_profile" (the default):
------8<------8<------8<------8<------8<------8<------8<------8<------
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
------8<------8<------8<------8<------8<------8<------8<------8<------
It is this that would make it not work. Now it is possible that your
distro doesn't have the code that sources ".bashrc" from
".bash_profile", but I don't like to suggest that people should make
such changes to their distros. The script will work for everyone, and
it is really the better way to do it since changing environment
variables in ".bashrc" can cause problems whether or not your distro
does this.
--
James Tyrer
Linux (mostly) From Scratch
___________________________________________________
This message is from the kde mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.
More information about the kde
mailing list