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.
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.
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
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).
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.ps russian-koi8.txt a2ps -X ms-cp1251 -o russian.ps russian-win.txt a2ps -X iso5 -o russian.ps russian-iso5.txt
If you want to print all ASCII texts using koi8 encoding add the following to your ~/.a2ps/a2psrc
Options: --encoding=koi8
set charset="koi8-r" # use KOI8-R charset by default set send_charset="koi8-r" # send KOI8-R characters by default set print_cmd="a2ps -X koi8 -2 --pretty-print=mail --strip-level=1 | lpr " set arrow_cursor # use -> instead of hiliting the whole line set sort="date" # Sort messages by date
Do not worry about mails in M$ cp1251 encoding. Mutt will automatically recode them into koi8-r encoding.
Everything is hooked up in Debian. Just use it:
\documentclass[letterpaper,12pt]{article} \usepackage[koi8-r]{inputenc} \usepackage[english,russian]{babel} % load Babel setup for English \begin{document} Русский текст о чем-то очень важном. Таком важном что просто оторопь берет. Должны переносы в этом тексте быть нормальными. Правда русский и английский текст одновременно эта зараза не переносит. \end{document}
Modify file /etc/locale.gen to incluse appropriate locales. For example english and russian:
en_US ISO-8859-1 ru_RU KOI8-RAfter that run locale-gen which will generate locales.
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.
/dev/hda1 /win98 vfat noexec,rw,codepage=866,iocharset=koi8-r 0 3
> AppendLibraryPath: /usr/cluster/packages/sharatype-2.0.4/afm:/usr/cluster/packages/sharatype-2.0.4/pfb
oka08:/usr/share/a2ps/afm# diff make_fonts_map.sh~ make_fonts_map.sh 61c61 < s/FontName[ ]*\([-a-zA-Z]*\).*/\1/p --- > s/FontName[ ]*\([-a-zA-Z0-9]*\).*/\1/p
oka08:/usr/share/a2ps/afm# mv fonts.map fonts.map.orig oka08:/usr/share/a2ps/afm# mv fonts.map.new fonts.map
oka08:/usr/share/a2ps/endocding # cp /usr/cluster/packages/sharatype-2.0.4/a2ps/add/*.edf .
a2ps -X koi8 -o russian.ps russian.txt
texconfig init
Alternatively you can use script texconfig for this purpose
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).
Linux Cyrillic HOWTO (rus)
XEmacs Russification
XKB Keyboard Extension