LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How I localize Slackware (http://www.linuxquestions.org/questions/slackware-14/how-i-localize-slackware-409858/)

kornerr 01-30-2006 11:36 PM

How I localize Slackware
 
I think it's high time to create a small HOWTO on How to localize Slackware.
Add posts about your language to help others.

This post is about Russian language.
This works in Slackware10.x.
I localize my system to KOI8-R, because mc which I use sometimes, doesn't understand UTF-8. And just because KOI8-R really rocks!

First, I made a script to localize system:
Code:

#!/bin/bash

#Console localization
#this creates executable font script which will be run every system startup to set font for console
touch /etc/rc.d/rc.font
chmod +x /etc/rc.d/rc.font
#this removes unnecessary now OLD font script
rm -f /etc/rc.d/rc.font.new
#this soft-links console key map to necessary dir (to avoid copying and wasting space)
ln -s /home/other/src/ru42.map.gz /usr/share/kbd/keymaps/i386/qwerty/
#this writes the necessary contents to rc.font
echo 'setfont -v cp866-8x16
mapscrn koi2alt
for i in 1 2 3 4 5 6; do
    echo -ne "\033(K" > /dev/tty$i
done
loadkeys ru42'>/etc/rc.d/rc.font

#System localization
#this writes necessary contents to lang.sh which is also run every startup to set system language
echo 'export LANG=ru_RU.KOI8-R
export LC_MESSAGE=C
export LC_NUMERIC=C'>/etc/profile.d/lang.sh

#this is necessary too...
echo 'russian ru_RU.KOI8-R
ru ru_RU.KOI8-R
ru_RU ru_RU.KOI8-R'>/usr/share/locale/locale.alias

#this runs rc.font so that we don't have to wait for console localization untill next startup
/etc/rc.d/rc.font

#this copies Windows fonts, I wonder why they look so ugly in Windows, and so pretty in X
#/home/other/fonts contains Windows TTF fonts
cp /home/other/fonts/* /usr/X11/lib/X11/fonts/cyrillic

I run the script after every Linux re-installation, then I reboot and get russified console. Then I edit /etc/X11/xorg.conf (actually I've edited it long ago, and now just keep it between re-installations) this way:
Code:

- - - -
Section "InputDevice"
- - - -

Option "XkbLayout"  "en_US,ru(winkeys)"
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"

End Section
- - - -

The first line allows two layouts in X, the second one allows me to switch layouts pressing Alt+Shift, also when Russian is on Scroll Indicator is on.

Ok, now console and X undestand Russian very well. But I have some Windows partitions and want to be able to see correct Russian filenames there. (I have FAT32 for Windows to be able to write from Linux, but it shouldn't make any difference)
CD-ROMS and floppies may be with Russian filenames as well.
I edit /etc/fstab like this:
Code:

- - - -
/dev/hda7        /mnt/windata    vfat        iocharset=koi8-r,umask=000 0  0
/dev/hda8        /mnt/winsys      vfat        iocharset=koi8-r,umask=000 0  0
/dev/cdrom      /mnt/cdrom      iso9660    iocharset=koi8-r,noauto,group,ro  0  0
/dev/fd0        /mnt/floppy      vfat        iocharset=koi8-r,noauto,group    0  0
- - - -

"umask=000" means that every user is able to write to Windows partitions.
Also I use kernel 2.4.x, while in 2.6.x "iocharset" option is deprecated and you should use smth like "nls" (see FAT32 and NTFS sections of "man mount" for more info).

And lastly, when I was using KDE (now I'm using XFCE ;) ) I had to:
1) select System Admin -> Font Installer in Control Center (yeah, just select);
2) add Russian language in Regional & Accesibility -> Country / Region & Language.

That should be enough to feel yourself like a real Russian Linux user ;)

PS: ru42.map.gz

slacksteep 01-31-2006 08:05 AM

...this sounds like a very nice and clean way to do it ... too bad I am having this localization
problem with Hellenic alphabet. All the HOWTOs I 've collected from the internet are very poor or oudated and seem to fix problem partially!
Wish I was russian for a change!
I think your post will help me though in going about the hellenic localization!
cheers

notAcoolNick 08-21-2006 04:23 AM

Few questions
 
Dear kornerr,
Thank you very much for such detailed instructions. I have a followup question.

What do I to do if I don't want to "localize" my box to Russian. I.e. I live in US I am pretty happy how the date is displayed. What if I just want to be able to view Russian webpages in various encodings in FireFox? Right now I can only use statically linked netscape to do that (which by the way tells me that X11 sees the russian fonts). For a while konquerror was allowing me to do that. I use 10.2 now (stock, no tweaks). What should I do to be able to view Russian webpages using recently installed FireFox 1.5.0.6, or Mozilla, or Konquerror?

Alien Bob 08-21-2006 05:15 AM

That would be fixed by installing a Unicode font that contains the cyrillic characters.
For instance, try the free Thryomanes Truetype font at http://www.io.com/~hmiller/lang/ . Direct link is Thryomanes12.zip

Eric

kornerr 08-21-2006 05:48 AM

I cleared the contents of /etc/profile.d/lang.sh, rebooted and got what you want.
So you can try to simply copy TTF fonts from (I didn't mention, but I have russian Windows version, so fonts are probably russified) Windows fonts directory.
Or try that Unicode font suggested by Alien Bob.


All times are GMT -5. The time now is 03:19 AM.