LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Setting multiple locales in Slackware. (https://www.linuxquestions.org/questions/slackware-14/setting-multiple-locales-in-slackware-4175460874/)

Randicus Draco Albus 05-06-2013 06:26 AM

Setting multiple locales in Slackware.
 
I have looked through Slackware's documentation for setting locales. It shows how to change the locale, but I did not find anything about setting up multiple locales. The ability to choose between more than one language during log-in is something I really like and would like to know if Slackware supports such a feature. Either my search skills are insufficient or this topic has not come up on the board. My previous forays into Slack were cursory, but if I cannot overcome a couple minor issues with the latest Debian, I would give Slackware a serious test. The ability (or lack thereof) to have multiple locales is the kind of thing I would like to know in advance.

Diantre 05-06-2013 07:04 PM

I don't really understand what you mean when you say "during log-in". How do you log in? Runlevel 3 or 4?

I always start in runlevel 3. In the console, it all comes down to changing the $LANG variable to your desired locale. It's possible to create a script which asks you the locale you want and set the $LANG accordingly, then run it immediately after you log in.

There's lots of information about localization in SDP.

Randicus Draco Albus 05-07-2013 01:48 AM

Quote:

I don't really understand what you mean when you say "during log-in"
When using a DM, having the choice of language/locale.

Quote:

In the console, it all comes down to changing the $LANG variable to your desired locale. It's possible to create a script which asks you the locale you want and set the $LANG accordingly, then run it immediately after you log in.
That looks similar to a suggestion I received a while ago from someone on creating a way to choose both GUI and language when logging in from the terminal, but I have yet to try it. Looks promising.

Quote:

There's lots of information about localization in SDP.
That is the first place I looked. I saw lots of information about setting one locale, but nothing about multiple locales, other than setting different locales for different users. However, your explanation of setting language variables before logging into the GUI sheds new light on the SlacDocs article. I would be surprised if Slackware cannot accommodate multiple locales, but the documentation is not clear enough on the subject for us muddle-headed people. Thanks for the input.

Didier Spaier 05-07-2013 02:30 AM

Quote:

Originally Posted by Randicus Draco Albus (Post 4946373)
When using a DM, having the choice of language/locale.

It is not possible with KDM, at least as shipped in Slackware AFAIK (but I am not a KDM user and I could be wrong. I just launched it with "telinit 4" to look at the UI).

On this page from Debian's documentation I read:
Quote:

In GDM login screen, pick a proper locale from the list of installed locales by clicking the locale button in the bottom of the screen.
But I don't know if this feature is specific to Debian. If it is not you are in luck, as gdm, though not included in Slackware, is available through http://slackbuilds.org. It that's really what you want I can try and let you know if that works.

Randicus Draco Albus 05-07-2013 02:45 AM

I currently use GDM with my Debian system. Works beautifully. I assume it is a Gnome feature. If I remember correctly, it was the same with Ubuntu, but that was a while ago, so my memory is more than a bit fuzzy.

KDM? I have never used it. I usually avoid anything KDE, because of the ridiculous amount of bloat. Although I can now re-consider that stance with my new powerful computer.:D

Didier Spaier 05-07-2013 03:12 AM

It works.
 
I just did that:
(1) Go to http://www.slackbuilds.org/ to download what is needed to build libgnomecanvas and gdm.
(2) Build and install libgnomecanvas
(3) Build and install gdm
(4) (as root) "telinit 4" to change the run level
(5) in GDM greetings screen, choose locale Spanish (Costa Rica)

I am now under XFCE (but of course you can choose another DE or WM in gdm). The UI is in Spanish and LANG is set to es_CR.utf8

Please note that I did zero configuration in Slackware to get there, which shows that it is well designed ;)

ruario 05-07-2013 03:21 AM

@Didier Spaier: Thanks for that! Yep, this allows me to flick between English and Norwegian for login with Xfce, though it does not work for KDE (and yes I have kde-l10n-en_GB-4.8.5-noarch-1 and kde-l10n-nb-4.8.5-noarch-1 installed).

I also notice that locale under Xfce, everything is flipped to nb_NO.UTF-8, where as it remains en_GB.UTF-8 (my default) for KDE.

Randicus Draco Albus 05-07-2013 03:26 AM

Quote:

Originally Posted by Didier Spaier (Post 4946420)
It works.

Thanks. I shall definitely keep that in mind if I need to take the plunge.

ruario 05-07-2013 03:32 AM

Quote:

Originally Posted by ruario (Post 4946423)
@Didier Spaier: Thanks for that! Yep, this allows me to flick between English and Norwegian for login with Xfce, though it does not work for KDE (and yes I have kde-l10n-en_GB-4.8.5-noarch-1 and kde-l10n-nb-4.8.5-noarch-1 installed).

I also notice that locale under Xfce, everything is flipped to nb_NO.UTF-8, where as it remains en_GB.UTF-8 (my default) for KDE.

Ah, got it. I had preferred languages defined in KDE's System Settings/Locale section. I probably set that up in the past. Anyway I removed all entries and it works. Now Gdm sets the language and KDE uses this.

ruario 05-07-2013 03:49 AM

Hmm .. still some weirdness. If I start konsole my locale is set to en_GB.UTF-8 (as defined in my ~/.profile) initially but if I open an new window or tab it is nb_NO.UTF-8 (as defined by GDM).

Didier Spaier 05-07-2013 04:08 AM

And if you start an xterm? or remove the setting from your ~.profile?

ruario 05-07-2013 04:51 AM

An xterm gives me: nb_NO.UTF-8
editing out of the ~/.profile causes the first konsole to become: en_US (as defined in /etc/profile.d/lang.sh)

ponce 05-07-2013 05:01 AM

could you have some leftovers in ~/.bash_profile or ~/.bashrc ?

ruario 05-07-2013 07:39 AM

@ponce: they are both blank.

Actually I have just realised that the only the first tab has settings taken from /etc/profile (and /etc/profile.d/). For example the first tab has the color aliases /etc/profile.d/coreutils-dircolors.sh but subsequent tabs and or konsole windows do not. I suspect this has always been the case and I haven't noticed it because I don't generally use multiple tabs konsole, rather I fire up one and then start tmux.

It seems like all extra konsole tabs and windows are not having all the variables set.

ruario 05-07-2013 07:46 AM

Ok, I see what konsole seems to be doing. It treats the first tab as a login shell but not the others. Hmm ... weird. I guess that makes sense in some way.


All times are GMT -5. The time now is 10:56 AM.