| 1 |
0 Introduction |
| 2 |
-------------- |
| 3 |
|
| 4 |
This version of gsmlib contains national language support (NLS) using |
| 5 |
the GNU (or OS-supplied) gettext library. gettext eases the handling |
| 6 |
of translations of (usually english) output messages to other |
| 7 |
languages by introducing the concept of message catalogs. |
| 8 |
|
| 9 |
Message catalogs can exist in various formats. The human-readable and |
| 10 |
-editable format is the PO file format. I have written a PO-file for |
| 11 |
the german language (de.po). These human-readable files are then |
| 12 |
translated to MO files which can be used by the gettext library. |
| 13 |
|
| 14 |
Please refer to the GNU gettext documentation (at the time of this |
| 15 |
writing gettext-0.10) for further details. |
| 16 |
|
| 17 |
|
| 18 |
1 Compiling gsmlib with localized messages |
| 19 |
------------------------------------------ |
| 20 |
|
| 21 |
Gsmlib is compiled by default with NLS enabled. If you don't want |
| 22 |
NLS invoke configure with the option |
| 23 |
|
| 24 |
./configure --disable-nls |
| 25 |
|
| 26 |
|
| 27 |
2 Adding new message dialogs |
| 28 |
---------------------------- |
| 29 |
|
| 30 |
1. Edit the ALL_LINGUAS line in "source/configure.in" and add your |
| 31 |
language, eg. French: |
| 32 |
|
| 33 |
ALL_LINGUAS="de fr" |
| 34 |
|
| 35 |
2. Execute "autoconf" to create a new "configure" script (possible |
| 36 |
problem: incompatible "autoconf") |
| 37 |
|
| 38 |
3. Now issue "./configure" in the "sources" directory. |
| 39 |
|
| 40 |
4. go to the "po" subdirectory |
| 41 |
|
| 42 |
5. do a "touch fr.po" to create an initially empty PO-file. |
| 43 |
|
| 44 |
6. do a "make update-po". This extracts all the strings from the files |
| 45 |
listed in "POTFILES" and puts them with empty translations into "fr.po" |
| 46 |
(it also updates existing po-Files such as "de.po"). |
| 47 |
|
| 48 |
7. Now use the editor of your choice to provide translations in |
| 49 |
"fr.po". There is an emacs major mode (po-mode) that eases this |
| 50 |
process. |
| 51 |
|
| 52 |
8. now issue "make". This causes an "fr.mo" to be created. |
| 53 |
|
| 54 |
|
| 55 |
3 Adding new strings to gsmlib source code |
| 56 |
------------------------------------------ |
| 57 |
|
| 58 |
1. If you add new strings to the gsmlib source code that need |
| 59 |
translation enclose them with "_(" and ")" (see gettext documentation |
| 60 |
for special cases). |
| 61 |
|
| 62 |
2. go to the "po" directory. |
| 63 |
|
| 64 |
3. do a "make update-po". This updates all existing PO-files (removing |
| 65 |
obsolete translations, providing new, emptry entries). |
| 66 |
|
| 67 |
4. Provide translations for the new, empty entries (ideally using |
| 68 |
emacs po-mode) |
| 69 |
|
| 70 |
5. now issue "make". This causes up-to-date MO-files to be created. |
| 71 |
|
| 72 |
|