Using AbiWord on Unix with non-Latin1 Locales

Tomas Frydrych <tomas@frydrych.uklinux.net>

Contents

1. Introduction

2. 8-bit locales

2.1 Fonts

2.2 Keyboard

3. UTF-8 locale

3.1 Fonts

3.2 Keyboard

1. Introduction

AbiWord supports the standard localization mechanism using LANG and LC_ variables (if you are not familiar with this mechanism see `man locale' as well as the relevant Linux HOWTOs). It works with both 8-bit locales and UTF-8 locale. However, if you are using locale different than Latin-1 (iso 8859-1) there are some things you will need to do to get correct behavior. Please note that this document does not contain instructions how to set up a particular locale on your machine, only things you will need to do to get AbiWord working under non-Latin-1 locales. (For general instructions on how to setup a particular locale on your computer, you should see the relevant Linux HOWTO.)

In the following a command prompt will be indicated by '#'.

2. 8-bit locales

2.1 Fonts

The default AbiWord locale is en_US. If you use a different, non-Latin-1 locale, you will need to provide your own fonts. AbiWord fonts should be located in /usr/share/AbiSuite/fonts or /usr/local/AbiSuite/fonts directory (unless you chose to install elsewhere, of course). You need to create a subdirectory in the fonts directory named according to your encoding. For instance if you are going to use Hebrew locale, you create a directory ISO-8859-8. The name of this directory has to correspond exactly to the encoding reported by your locale variables. If you are using Bash, try

# echo $LANG

You should see something like

# he_IL.ISO-8859-8

It is important that the encoding (the part after the dot) is specified explicitly, i.e., if you see something like

# he_IL

it will not work. Setting the LANG variable prior to starting AbiWord is easy, in Bash you do something like

# LANG=he_IL.ISO-8859-8

# export $LANG

You do not have to make a system-wide modification of your $LANG setting, all that is needed is that the variable is set prior to running AbiWord. I personally use a short script to run Czech localization of AbiWord which I call abicz and which looks something like this:

#!/bin/sh

LANG=cs_CZ.ISO-8859-2

export $LANG

abiword

This way I do not have to change my normal LANG setting, and do not have to remember modifying it manually when I want to run Czech localization of AbiWord.

But now back to the fonts; once you have created the locale specific directory, you put your fonts in it in the same manner you would install additional fonts into the main fonts directory; you will find instructions in the separate document AbiWord_and_Unix_Fonts.zabw.

2.2 Keyboard

There are some keyboard issues to be taken care of as well, not because AbiWord would require something unusual, but because keyboard on non-Latin1 localizations of common Linux distributions is frequently set up incorrectly. You will find the details in the Troubleshooting section of AbiWord_and_Unix_Fonts.zabw.

3. UTF-8 locale

3.1 Fonts

To use UTF-8 locale with AbiWord, you will need to install Unicode fonts; AbiWord does not support font sets. In my experience, it is not possible to set up pfa/pfb font under XFree86 4 to behave as a Unicode font (if you find a way to register a pfa font with the server as a Unicode font, please let me know, so that I can update this document). Thus you will have to use TTF fonts only. Otherwise, the general procedure is the same as for 8-bit locales, although it might be better installing the fonts directly into the font directory, rather than a subdirectory, replacing any AbiWord fonts, with your own. You will find the procedure described in the document AbiWord_and_Unix_Fonts.zabw. There are two important things to remember:

(1) your LANG has to specify utf-8 as the encoding, i.e.,

# echo $LANG

should return something like

# en_GB.utf-8

If it does not, you need to modify $LANG along the lines described in section 2.1

(2) The encoding part of the fonts entry in fonts.dir has to be be iso10646-1, e.g.,

arial.ttf -monotype-Arial-medium-r-normal--0-0-0-0-p-0-iso10646-1

3.2 Keyboard

Under UTF-8 locale AbiWord uses the same keyboard handling mechanism that the UTF-8 enabled xterm does, and your keyboard can generate arbitrary Unicode values. The details of assigning these values to your keyboard are found in the Troubleshooting section of AbiWord_and_Unix_Fonts.zabw.