LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 10-30-2012, 09:22 AM   #1
Jotto
LQ Newbie
 
Registered: Oct 2012
Posts: 7

Rep: Reputation: Disabled
Question Can't get Bulgarian locale to work properly


Hello.

It seems that i can't get my locale to work properly. When i try to browse my home folder or external hdd (in my case) with dolphin, konqueror, thunar or just a simple shell i get strange symbols like ??????? or Свалени. This is all on Slackware64-14 full install.

So i've done some reading and figured out that i have to change my settings in /etc/profile.d/lang.sh to export LANG=bg_BG and left everything else as-is.
The strange symbols disappeared and everything worked fine, but then logged as root i tried to install some packages with pkgtool and pkgtool's menu looked strange. Then i tried export LANG=bg_BG.UTF-8, pkgtool looked fine, but when i tried some text editing in terminal with nano it's menu's were also with strange symbols.

I really want to learn and solve problems, but particularly this one i can't understand... yet

Thanks in advice for your help.
 
Old 10-30-2012, 10:20 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Welcome to LQ.

The keybord settings must be applied in KDE :
Menu : Configure Your Desktop
( Or : $ systemsettings )
> Hardware > Input Devices >> Keyboard : Layouts >> Configure Layouts,
.. and then add Bulgarian, and remove "the other <country>".

Now everything you type, should be 'Bulgarian'.
*** The settings must be applied in the "user KDE",
and also "root KDE" ( if you ever want to login as root.)

.
 
Old 10-30-2012, 10:37 AM   #3
Jotto
LQ Newbie
 
Registered: Oct 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I can type in Bulgarian - пример. My problem is not about keyboard layouts. I can't configure my system to display properly cyrillic+latin characters. I set export LANG=bg_BG in "/etc/profile.d/lang.sh" and dolphin, konkueror, thunar and bash work fine. Folder names written in bulgarian are displayed properly, but then some applications like pkgtool and nano don't display fine (haven't tried other programs).
 
Old 10-30-2012, 04:00 PM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,021

Rep: Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966
Try 'export LANG=bg_BG.utf8' instead.
 
Old 10-30-2012, 04:01 PM   #5
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 162

Rep: Reputation: 45
Good evening fellow slacker,
Recently I have been working with Slackware localization for Lithuanian language. So I can share what I've learned and hopefully this will be more or less useful to you.

First, if you are doing localization stuff, there is good chance that you want to use UTF-8 locales, if you do, then you need 4 things:
1. append=" vt.default_utf8=1" line in lilo.conf file
2. edit /etc/profile.d/lang.sh and /etc/profile.d/lang.csh files to set system-wide locale
3. install good Unicode font, like terminus-font from SBo
4. edit your ~/.bashrc and/or ~/.bash_profile files to enable font and source /etc/profile

Usually there are two scenarios with localization:
1. Localize whole system. (set bg_BG system-wide)
2. Per user localization (leave en_US system-wide, set bg_BG for you)

Now this is what I do for system-wide localization:
1. Edit /etc/lilo.conf and add utf-8 append if it isn't there:
Code:
# Append any additional kernel parameters:
append=" vt.default_utf8=1"
boot = /dev/sda
compact
Then issue lilo command to update boot loader. If you needed to do this step, then you will need to reboot after all below steps are done.
2. Edit /etc/profile.d/lang.sh and /etc/profile.d/lang.csh to set needed locale:
Code:
#/etc/profile.d/lang.sh
#export LANG=en_US.ISO8859-1
export LANG=lt_LT.UTF-8
and:
Code:
#/etc/profile.d/lang.sh
#export LANG=en_US.ISO8859-1
export LANG=lt_LT.UTF-8
3. Install Terminus-font from slackbuilds.org
4. Edit ~/.bash_profile
Code:
#~/.bash_profile
# Source global definitions
if [ -f /etc/profile ]; then
    . /etc/profile
fi
# Set Terminus font
if [ $TERM = "linux" ]; then
    setfont ter-v16n
fi
Then edit ~/.bashrc and add:
Code:
# Source global definitions
if [ -f /etc/profile ]; then
    . /etc/profile
fi
# Set Terminus font
if [ $TERM = "linux" ]; then
    setfont ter-v16n
fi
Thats it. After this I have Slackware speaking Lithuanian in command line and in GUI system-wide. However, I hear it's advised (not sure why) to leave system-wide setting to non-Unicode en_US locale and only enable Unicode locales for users who needs them. In this scenario I do similar steps, but slightly different. First 3 steps are identical, you just need to leave lang.sh and lang.csh set to en_US or en_US.UTF-8 and then edit your ~/.bashrc and/or ~/.bash_profile files to set user locale:
Code:
#~/.bash_profile
# Source global definitions
if [ -f /etc/profile ]; then
    . /etc/profile
fi
export LANG=lt_LT.UTF-8
if echo $LANG | grep -iq UTF ; then
  export G_FILENAME_ENCODING="@locale"
fi
# Set Terminus font
if [ $TERM = "linux" ]; then
    setfont ter-v16n
fi
and:
Code:
#~/.bashrc
# Source global definitions
if [ -f ~/.bash_profile ]; then
    . ~/.bash_profile
fi
Hope this helps. But do keep in mind that this is just how I do it and I am not 100% sure on .bash part (maybe someone can explain more clearly), but both scenarios works well for me so far.
 
1 members found this post helpful.
Old 10-30-2012, 04:14 PM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,021

Rep: Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966
Quote:
Originally Posted by Totoro-kun View Post
However, I hear it's advised (not sure why) to leave system-wide setting to non-Unicode en_US locale and only enable Unicode locales for users who needs them.
Probably you were told that by the 'liloconfig' script:
Code:
ask_utf() {
 dialog --defaultno --title "USE UTF-8 TEXT CONSOLE?" --yesno \
"Beginning with the 2.6.24 kernel, the text consoles default to UTF-8 mode.  \
Unless you are using a UTF-8 locale (\$LANG setting), using the old default \
of a non-UTF text console is safer until some issues with various console \
programs are addressed.  This option has no effect on the use of UTF-8 with X.  \
\"No\" is the safe choice here." 10 70
}
But as you are using an UTF-8 locale there is no problem in your case. Same for me, I set LANG to fr_FR.utf8 and am very happy with this setting.

In fact I can't think of a really good reason nowadays not to use UTF-8. I would even advise people whose US English is the native (and maybe the sole) language to set LANG to en_US.utf8. It won't hurt

PS Please someone correct me if I am wrong. If there are any caveat or inconvenience to do that I would be pleased to hear about it, so I will learn one more thing.

PS2 I am myself studying the feasibility of localizing at least Slackware's installer so maybe we could share ideas? I will open a new thread on that topic.

Last edited by Didier Spaier; 10-30-2012 at 04:28 PM.
 
1 members found this post helpful.
Old 10-30-2012, 05:08 PM   #7
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,021

Rep: Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966Reputation: 966
Following my previous post, see here.

Last edited by Didier Spaier; 10-30-2012 at 05:21 PM.
 
Old 10-30-2012, 05:25 PM   #8
Jotto
LQ Newbie
 
Registered: Oct 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Everything works like a swiss clock. Thank you.

I updated /etc/lilo.cfg with the options mentioned, /etc/profile.d/lang.sh from "export LANG=en_US" to "export LANG=bg_BG.UTF-8" and /etc/profile.d/lang.csh from "setenv LANG en_US" to "setenv LANG bg_BG.UTF-8".
I noticed that after the restart my menus changed to bulgarian (translated from english) since i use KDE and i have KDE international support package installed. So from this i came to conclusion that my problem might be caused by lang.csh's setenv bg_BG.UTF-8. I am not sure but i think last time i tried to change these settings i had no success, but now when i think back i think that i had no kde international support installed. I don't know if this caused my problem, but i'm happy that everything works now, thanks again.

The idea for better explanation about locales is good.

EDIT: I forgot to mention that i didn't install the font and everything still worked. I haven't tried the per user method, but i will. Strange thing is that i don't have these files in my home folder ( i know they are hidden ), should i created them?

Last edited by Jotto; 10-30-2012 at 05:33 PM.
 
Old 10-31-2012, 01:35 AM   #9
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 162

Rep: Reputation: 45
Good morning,
I'm glad that you made it work.

As for .bashrc and .bash_profile, they are not included in Slackware by default and I guess not really needed for a system-wide localization as system will source /etc/profile anyway, however they are very useful if you want to customize your command prompt and bash environment, so you might want to investigate them further if you use terminal a lot. For per user localization, it is enough to create ~/.profile file:
Code:
export LANG=lt_LT.UTF-8
if echo $LANG | grep -iq UTF ; then
  export G_FILENAME_ENCODING="@locale"
fi
Since I am using .bashrc and .bash_profile files, I find I do not need .profile file.

It seems, that the font part depends on language, since I had some troubles displaying Lithuanian letters in file system untill I installed this font.
 
  


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
R.A.T. 7 Mouse - Doesn't work properly at first, but restarting X makes it work spudgunner Linux - Hardware 3 01-13-2012 10:48 PM
Greetings from a Bulgarian old-boy Sanmayce LinuxQuestions.org Member Intro 6 07-19-2010 10:40 AM
DNS lookup doesn't work, ping, firefox will not work properly lovemov Linux - Networking 2 04-23-2009 02:30 PM
is resierfs 4 ready?, and can it work under utf8 locale ? SciYro Linux - General 4 02-02-2005 10:16 PM
does java Locale.getDefault() work for you ? dave bean Programming 1 01-12-2004 06:13 AM


All times are GMT -5. The time now is 03:18 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