Originally Posted by mlambrechts
Does anyone know if in opensuse it is possible to add a user with a different language than root. I mean, that every user can open his desktop in his specific language? I am root+user in dutch. But my wife is Brazilian, and I want to give her a user account completely in Portuguese. Is this possible?
Yes. Though "localization" (it's the label we use to talk about this) is a thing that sometimes can depend a bit on the distro you use.
Some desktops, like kde, have specific support for languages. In kde you can install support for lots of languages by installing the kde-i18n package. It can be a big package or it can be a set of small packages (one per language) depending on your distro.
In any case, once you have installed the language packages, you can change the localization settings from kcontrol (the kde control panel). I don't know if there's something similar in gnome or xfce.
For the rest of the system, the language and localization settings are usually controlled by the value of the LC_* variables.
To check the currect value, you have to open an xterm (or operate in plain command line) and do type this command:
The "locale" command tells us what the actual localization settings. So, to change the localization settings would be as easy as to change the value of these variables. The master one -which controls the rest of them- is LC_ALL. LANG is used by many programs to control the language as well. For example, with the settings above, if I fire up gimp I get this (screenshot):
On the contrary, if I use the C locale, this is what I get:
As you can see, you can temporarily change the locale to run a single command, like this:
"C" is the posix locale, and it happens to be mostly equivalent to the english ones. It's the default locale if no locale is set.
The next piece of the puzzle is to find a correct locale for your wife. To see the available locales, you can use this command to see the available locales:
If my memory serves correctly, a good locale for your wife would be either of pt_BR@.utf8 or pt_BR.iso-8859-15 (or pt_BR.iso-8859-1, not sure).
I advise you to use utf8 locales from now on, since that's what the future will bring us anyway, and using any other thing is not smart nowadays unless you have a given purpose in mind. So, i'd just use pt_BR.utf8.
If that locale is not on the list of available locales, you will need to build it yourself. The list of locales is stored into /etc/locale.gen. I share mine as a example:
You can put as many as you want, change them accordingly to include all the locales you want to use in your system (and more if you want).
Then as root you need to run:
The locales should be generated, now they should be listed in the output of locale -a, and you should be able to test any locale by doing
LC_ALL=<chosen locale> gimp
You can also test nano or any other program to test. The language of the interfact should adapt itself to the locale.
Now the problem is how to setup it widely for the current user. Each distro has a different way to do this. But if you want to set this locale only for your wife, there's an easy way. On the command line department, you just need to include a couple of lines in these two files on her home dir: ~/.bashrc and ~/.bash_profile, the lines are:
Those are mine, again, adapt them to her locale.
This might not work for X programs if you login directly into X, though. In that case, you should check the documentation for your distribution. Most distros heavily document the localization process. It's a common procedure.