LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-06-2013, 06:26 AM   #1
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Wallowing in a pit of despair.
Distribution: OpenBSD
Posts: 1,311
Blog Entries: 4

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.
 
Old 05-06-2013, 07:04 PM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 391

Rep: Reputation: 152Reputation: 152
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.
 
Old 05-07-2013, 01:48 AM   #3
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Wallowing in a pit of despair.
Distribution: OpenBSD
Posts: 1,311
Blog Entries: 4

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.
 
Old 05-07-2013, 02:30 AM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,410

Rep: Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122
Quote:
Originally Posted by Randicus Draco Albus View Post
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.
 
Old 05-07-2013, 02:45 AM   #5
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Wallowing in a pit of despair.
Distribution: OpenBSD
Posts: 1,311
Blog Entries: 4

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.
 
Old 05-07-2013, 03:12 AM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,410

Rep: Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122Reputation: 1122
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
 
3 members found this post helpful.
Old 05-07-2013, 03:21 AM   #7
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
@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.

Last edited by ruario; 05-07-2013 at 03:44 AM.
 
Old 05-07-2013, 03:26 AM   #8
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Wallowing in a pit of despair.
Distribution: OpenBSD
Posts: 1,311
Blog Entries: 4

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by Didier Spaier View Post
It works.
Thanks. I shall definitely keep that in mind if I need to take the plunge.
 
Old 05-07-2013, 03:32 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
Quote:
Originally Posted by ruario View Post
@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.

Last edited by ruario; 05-07-2013 at 03:44 AM.
 
Old 05-07-2013, 03:49 AM   #10
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
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).
 
Old 05-07-2013, 04:08 AM   #11
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,410

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

Last edited by Didier Spaier; 05-07-2013 at 04:10 AM.
 
Old 05-07-2013, 04:51 AM   #12
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
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)

Last edited by ruario; 05-07-2013 at 07:49 AM.
 
Old 05-07-2013, 05:01 AM   #13
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,460

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
could you have some leftovers in ~/.bash_profile or ~/.bashrc ?
 
Old 05-07-2013, 07:39 AM   #14
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
@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.
 
Old 05-07-2013, 07:46 AM   #15
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,874

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting locales and languages on Ubuntu Server 12.04 \/4A Linux - Server 2 04-22-2013 03:18 PM
Trouble Setting Up Locales in CLFS fatsheep Linux From Scratch 0 10-26-2006 05:14 PM
Setting locales dun_noe Debian 4 04-09-2005 03:45 AM
Setting up Slackware 9.1 to use multiple network cards? Lynx2112 Slackware 7 06-10-2004 05:52 PM
setting files for specific locales chii-chan Linux - General 4 11-02-2003 11:00 PM


All times are GMT -5. The time now is 09:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration