Linux Belarusian HOWTO Alexander Mikhailian, mikhailian@altern.org v.0.1.4, 25 June 2000 Short guide in setting up Belarusian language support in Linux con­ sole, X Window System, web-browsers, text editors, etc. Charsets described are windows-1251, iso-8859-5 and koi8-ru. Belarusian char­ acters can also be found in koi8-ub, koi8-c and of course, Unicode. Although this HOWTO is Linux-specific, many advices are applicable to other UNIX-like systems. ______________________________________________________________________ Table of Contents 1. Introduction 1.1 History 1.2 Comments 1.3 New Versions 1.4 Copyright 1.5 Acknowledgements and Thanks 2. System-wide setup 2.1 Choosing Charset 2.2 Windows-1251 in the kernel 2.3 Setting locale 2.4 Belarusian in console 2.4.1 Setting Belarusian with iso-8859-5 2.4.2 Setting Belarusian with windows-1251 2.4.3 Setting Belarusian with koi8-ru 2.5 Belarusian in X Window System 3. Editing texts 3.1 Emacs 3.2 Spell-checking 3.3 TeX 4. Browsers 4.1 Netscape 4.2 Lynx 5. Mailers 5.1 Netscape Messenger 5.2 Mutt 6. Further support ______________________________________________________________________ 1. Introduction 1.1. History This document was started in September 15, 1999 by Alexander Mikhailian 1.2. Comments Comments on this HOWTO may be directed to the author mikhailian@altern.org. 1.3. New Versions The newest version can always be found on http://www.bellinux.f2s.com 1.4. Copyright This manual may be reproduced in whole or in part without restrictions. 1.5. Acknowledgements and Thanks Thanks to everyone that gave comments as I was writing this. 2. System-wide setup 2.1. Choosing Charset As for now, the best choice seems to be windows-1251. It gives the user compatibility with MS Windows which is a must-have for many of us. If you do not care about compatibility, iso-8859-5 is the best supported and easiest to set up. Note that Belarusian support package from http://www.bellinux.f2s.com contains all the files mentioned in the present HOWTO unless otherwise stated in the text. 2.2. Windows-1251 in the kernel Windows-1251 support in the kernel is needed mostly to visualize MS Windows filenames in Cyrillic with the console and X Window system localized in windows-1251. As latest FAT file systems store filenames in Unicode, we have to define the output charset of the Virtual File System layer. To apply the windows-1251 patch to the kernel: · cd /path_to_your_kernel_source_tree · patch -p0 < your_patch.patch · Recompile and reinstall the kernel. Refer to Kernel-HOWTO about the details. · Add `codepage=866,iocharset=microsoft-cp1251' to your mount options in order to get the filenames in windows-1251. 2.3. Setting locale · Do localedef -f CP1251 -i be_BY be_BY or localedef -f ISO8899-5 -i be_BY be_BY to compile the locale in windows-1251 encoding or iso-8859-5 encoding. · Check how it works by setting LANG=be_BY and running a locale-aware program like date or cal. 2.4. Belarusian in console 2.4.1. Setting Belarusian with iso-8859-5 There are two ways to set up Belarusian with iso-8859-5 · Load iso-8859-5 font · Load by2.kmap keymap or by.kmap Look at the scripts by.iso and by2.iso for an example. This method has one serious drawback - you will loose all pseudographic characters and, say, you Midnight Commander will look somewhat naked. The second method described below preserves all pseudographic characters: · Load UniCyr font · Load by2.kmap keymap or by.kmap · Load Application-Charset Map iso05.acm Look at the scripts by.iso2 and by2.iso2 for an example. Also beware that different Linux distributions have different console- related packages - console-tools or kbd. Abovementioned scripts are meant to work with console-tools which is by far more popular. 2.4.2. Setting Belarusian with windows-1251 There is no windows-1251 console fonts and the only way to get it work is · Load UniCyr font · Load by2.kmap keymap or by.kmap · Load Application-Charset Map cp1251.acm Look at the script by2.win for an example. 2.4.3. Setting Belarusian with koi8-ru There is no koi8-ru console fonts and the only way to get it work is · Load UniCyr font · Load by-stb.koi.kmap keymap or byru-stb.koi.kmap · Load Application-Charset Map koi8-ru.acm Look at the scripts by-stb.koi and byru-stb.koi for an example. 2.5. Belarusian in X Window System Dirty hack: · Install Cyrillic fonts for X Windows. You can only use iso-8859-5, koi8-ru and microsoft-1251. BTW, there is a big difference between koi8-ru and koi8-r. The latest does not have CYRILLIC LETTER BYELORUSSIAN-UKRAINIAN I and CYRILLIC LETTER SHORT U. · Make and install xruskb package which can be downloaded from http://www.bellinux.f2s.com · Replace .xmm files in your xruskb directory by those found in the folder modified_keymaps of belarusian-0.1.tar.gz distribution. · Add the following lines in your /.Xdefaults file xrus*modeButton1.labelString: BEL xrus*modeButton1.label: BEL · Run xrus jcuken-cp1251 or xrus jcuken-iso5 to start keyboard switcher. Right solution: A patch to XFree 3.3.5 and 4.0 from Aleksey Novodvorsky that allows the use of windows-1251 with XKB. The original location is at ftp.logic.ru/pub/logic/linux/be-locale but it is also available in Belarusian support package from http://www.bellinux.f2s.com. Lucky users of Linux-Mandrake RE get a patched XFree86 out of box. 3. Editing texts 3.1. Emacs For most Linux distributions, emacs is able to display Belarusian characters out of box. However, the following conditions should satisfy: · Cyrillic iso-8859-5 fonts should be properly installed. · Emacs-mule package should be installed. The user may want to change the default keyboard layout ("input method" in emacs slang) to jcuken. This feature is provided by belarusian.el along with some other goodies. Read the comments in the beginning of belarusian.el for details. 3.2. Spell-checking · If you do not have ispell 3.1.20, install it from any Linux distribution CD. · Download the package belspell.tar.gz. Unpack it and run buildhash belarusian.sml belarusian.aff belarusian.hash · Copy belarusian.hash to /usr/lib/ispell or wherever your ispell hash tables are. · in order to spell-check a file, type ispell -d belarusian yourfile.txt Getting belarusian ispell dictionary working with emacs is a bit tricky. · Copy ispell.el and ispell.elc into your `$EMACSBIN/../lisp' directory. · Copy temporarily `$EMACSBIN/../lisp/loaddefs.el' to `/usr/src/emacs-XX.X/lisp/loaddefs.el' where XX.X stand for emacs version number. · Do `M-x update-file-autoloads RET' and enter the path to the ispell.el. · Copy back loaddefs.el · Restart emacs 3.3. TeX from Aleksey Novodvorsky: You need TeX + babel + T2, e.g. teTeX >= 1.0. in order to get partial support for Belarusian, · put babel.sty, belarusianb.ldf and belarusianb.sty into "/usr/share/texmf/tex/generic/babel" · run "texhash" · To use Belarusian in LaTeX: add the following lines in the preamble: \documentclass[belarusian]{article} \usepackage[cp1251]{inputenc} \usepackage{babel} or \documentclass[belarusian]{article} \usepackage[iso88595]{inputenc} \usepackage{babel} 4. Browsers 4.1. Netscape It is often a problem to correctly visualize Belarusian-specific characters with Netscape. This is due to that last versions of Netscape look for any koi8-r font and, if they find one, they refuse to use other fonts for displaying Cyrillic pages. The problem is solved by removing koi8-r fonts from everywhere - X Window System font path and font server path.Then install koi8-ru, iso-8859-5 or windows-1251 and run xset fp rehash or restart X server. You will probably have to delete preferences and preferences.js from the Netscape home directory .netscape and even then you are not guaranteed to have Netscape work right. Netscape's handling of fonts has always been an obscure issue. Links to koi8-ru, iso-8859-5 and windows-1251 cyrillic fonts for X Window System can be found at http://www.bellinux.f2s.com 4.2. Lynx In order to view Belarusian sites, you have to set up you console to handle the encoding you need. See section ``'' for more details. Add the following lines to your .linxrc file. character_set=Cyrillic (windows-1251) preferred_language=be preferred_charset=windows-1251 or character_set=Cyrillic (ISO-8859-5) preferred_language=be preferred_charset=iso-8859-5 If the page you are browsing does not have an explicit charset declaration, press "o" and set the document charset manually. 5. Mailers 5.1. Netscape Messenger Netscape Messenger can not handle belarusian texts properly. The same applies to Mozilla. 5.2. Mutt Mutt handles a multitude of charsets and encodings with ease. If your console has windows-1251 support, add the following lines to your .muttrc: charset-hook "windows-1251" "cp1251" set charset="windows-1251" Mutt automatically converts all incoming messages for the screen output. It can also convert outgoing messages basing itself on a versatile pattern matching mechanism, e.g. the following line in .muttrc will force mutt to convert all messages sent to be- locale@iatp.unibel.by to koi8-r. send-hook '~t ^be-locale@iatp\.unibel\.by$' 'set send_charset="koi8-r"' 6. Further support A mailing list devoted entirely to Belarusian language support is available at be-locale@iatp.unibel.by. To subscribe, send a message to majordomo@iatp.unibel.by with the string "subscribe be-locale youremailaddress" in the body of the message Another mailing list that treats mostly linguistic issues is available at movaznaustva@egroups.com. To subscribe to it, send a message with empty body to movaznaustva-subscribe@egroups.com.