LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Opensuse: can you add users with different language? (https://www.linuxquestions.org/questions/linux-desktop-74/opensuse-can-you-add-users-with-different-language-647687/)

mlambrechts 06-07-2008 03:41 PM

Opensuse: can you add users with different language?
 
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?

google01103 06-07-2008 04:46 PM

seems that it would be a given

see http://elibrary.fultus.com/technical...a.y2.lang.html

if you're using kde open kcontrol -> region and accesibility -> country/region & language

if using gnome check in it's control center

i92guboj 06-07-2008 05:13 PM

Quote:

Originally Posted by mlambrechts (Post 3177812)
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:

Code:

$ locale
LANG=es_ES.utf8
LC_CTYPE="es_ES.utf8"
LC_NUMERIC="es_ES.utf8"
LC_TIME="es_ES.utf8"
LC_COLLATE="es_ES.utf8"
LC_MONETARY="es_ES.utf8"
LC_MESSAGES="es_ES.utf8"
LC_PAPER="es_ES.utf8"
LC_NAME="es_ES.utf8"
LC_ADDRESS="es_ES.utf8"
LC_TELEPHONE="es_ES.utf8"
LC_MEASUREMENT="es_ES.utf8"
LC_IDENTIFICATION="es_ES.utf8"
LC_ALL=es_ES.utf8

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):

http://jesgue.homelinux.org/other-files/gimp-es_ES.jpg

On the contrary, if I use the C locale, this is what I get:

http://jesgue.homelinux.org/other-files/gimp-C.jpg

As you can see, you can temporarily change the locale to run a single command, like this:

Code:

$ LC_ALL=C gimp
"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:

Code:

$ locale -a
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:

Code:

es_ES ISO-8859-15
es_ES.UTF-8 UTF-8
ca_ES.UTF-8 UTF-8
en_US ISO-8859-15
en_US.UTF-8 UTF-8

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:

Code:

$ locale-gen
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

Code:

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:

Code:

# Localization
export LANG=es_ES.utf8
export LC_ALL=es_ES.utf8

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.

mlambrechts 06-09-2008 09:02 AM

Thanks
 
Thank you very much for the reply. It was very helpful!


All times are GMT -5. The time now is 05:02 AM.