Internationalization/Russification of CKM Linux cluster

Notes for users

  1. Declare your language
  2. Displaying russian characters in xterm/Eterm/gnome-terminal etc.
  3. Entering russian characters from keyboard
  4. Setting up XEmacs
  5. Printing ascii files with a2ps
  6. Reading/Sending/Printing mails
  7. Russian in TEX

Declare your language

In principle the only thing you need to do is to set environment variable LANG=ru_RU.KOI8-R . After that all "clever" application should russify themselves. They will show russian menus and so on. One of the question is when/where to set this variable:

Do not declare your locales

Do not set environment variable LC_* Setting up LANG should be enough.

Displaying russian characters in xterm/Eterm/gnome-terminal etc.

I recommend using command line options. You can use ~/.Xresources and other tricks. But this is old style which is soon going to be replaced by more intuitive configuration tools. So creating button on desktop panel is perahaps the easiest and most effective way. You can find list of cyrillic fonts aliases in /etc/X11/fonts/cyrillic/xfonts-cyrillic.alias

Eterm --font 9x15-cyrillic 
xterm -fn 10x16bold-cyrillic

Eterm and gnome-terminal are clever enough to understand that you need cyrillic fonts once it checked your LANG environment variable.

Entering russian characters from keyboard

  1. Use command setxkbmap ru to set russian keyboard.
    setxkbmap ru                               (just give me the defaults)
    setxkbmap -option grp:ctrl_alt_toggle ru   (switch with Ctrl-Alt)
    setxkbmap ru-yawerty	                   (phonetic keyboard)
    setxkbmap ru-yawerty ak                    (my favorite phonetic modification)
    setxkbmap -compat group_led ru             (Scroll-Lock will be indicator)
    .... and many possible permutaions of above ....

    Naturally you may want to bind this command to an alias or button on gnome panel. After that start very useful keyboard indicator xxkb

  2. Alternatively (I do not recommend this method) use command xrus with appropriate keyboard layout. Note that the first method and this one are incompatible and will not work together.
    xrus jcuken-koi8.xmm
    xrus yawerty-koi8.xmm 

    It is quite useful to bind this command with little button on your desktop panel. Clicking with a right button on little menu would bring options of this little program. You can setup for example key-combination which would switch english/russian keyboards.

    Note This program works correctly for almost all programs. Most notable exception is Mozilla

    Note If xlock will start your keyboard will remain russian. Then you won't be able to enter correct passoword (which is usually in english). The easiest way is to open terminal window (Ctrl-Alt-F1) and killing xrus program: killall xrus After that logout from terminal window and return back to X terminal (Ctrl-Alt-F7).

Setting up XEmacs

Add the following line to ~/.Xresources:
Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-koi8-r

After that either restart your X session (logout and login again) or run command: xrdb -merge ~/.Xresources

Add the following to your ~/.xemacs/init.el file.

Printing ASCII files with a2ps

Most texts come in koi8-r coding. Some in windows (ms-cp1251) To print out such texts use a2ps.

a2ps -X koi8 -o russian-koi8.txt
a2ps -X ms-cp1251 -o russian-win.txt
a2ps -X iso5 -o russian-iso5.txt

If you want to print all ASCII texts using koi8 encoding add the following to your ~/.a2ps/a2psrc

Options: --encoding=koi8

Reading/Sending/Printing mails

Russian in TEX

Everything is hooked up in Debian. Just use it:

\usepackage[english,russian]{babel}   % load Babel setup for English


  Русский текст о чем-то очень важном.  Таком важном что просто оторопь
  берет.  Должны переносы в этом тексте быть нормальными.  Правда русский и
  английский текст одновременно эта зараза не переносит.


Notes for system administrator

  1. Generate locales
  2. Phonetic Keyboard
  3. Listing of Window$ files in Russian
  4. Setting up a2ps
  5. Setting up TEX
  6. Setting up apache
  7. Setting up XEmacs

Generate locales

Modify file /etc/locale.gen to incluse appropriate locales. For example english and russian:

en_US ISO-8859-1
ru_RU KOI8-R
After that run locale-gen which will generate locales.

Phonetic Keyboard

Copy file ru-yawerty to /etc/X11/xkb/symbols/ Thanks to Eugene Byrganov

Listing of Window$ files in Russian

Quite often desktop would contain Window$ VFAT partition and file names would contain russian letters. To enable display of them foloowing actions should be taken.

Setting up a2ps

Setting up TEX

Alternatively you can use script texconfig for this purpose

Setting up apache

Make sure that variable AddDefaultCharset is set to off . Othervise apache would not send correct Language charset for people who look on your web pages. (This is particularly annoying if your web page contains cyrillic characters. So users who browse your web-pages should always set View-->Character coding to KOI8-R manually).

Setting up XEmacs

Download file ru-keys.el and put it in directory /usr/share/xemacs21/site-lisp/

Acknowledgements and links

Thanks to Youri Kharlov and Dmitriy Patalakha who helped and encouraged me along the way. Most of this information was gathered all over the internet. Most notable resources are:

Linux Cyrillic HOWTO (rus)
XEmacs Russification
XKB Keyboard Extension

Alexander Kushnirenko
Last modified: Thu Feb 20 00:35:16 MSK 2003