http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz
[gnokii.git] / Docs / developers / gnokii / gettext-howto
1 1. What do I need?\r
2 \r
3 - a reasonably recent version of GNU gettext (e.g. 0.10.35)\r
4   Check the version using e.g. msgfmt -V\r
5 \r
6 - autoconf\r
7 \r
8 - gnokii distribution :-)\r
9 \r
10 - if you have the variable LINGUAS in the environment\r
11   (most Red Hats have, no idea about other distributions),\r
12   unset it\r
13 \r
14 \r
15 2. How to make gnokii.pot file?\r
16 \r
17 gnokii.pot file is a collection of all localizable strings\r
18 in the gnokii package. It will be generated automagically\r
19 and is included in the standard distribution package.\r
20 \r
21 If you need to regenerate it, goto "po" directory,\r
22 remove gnokii.pot and say\r
23 \r
24         make gnokii.pot\r
25 \r
26 \r
27 3.1 How to start translating for a new language?\r
28 \r
29 First, you would like to contact the authors or write\r
30 to the mailing list - maybe there already is someone\r
31 working on this translation. \r
32 \r
33 If you get the OK from the maintainer, there are several\r
34 steps to do:\r
35 \r
36 - add the code of your language to the ALL_LINGUAS line\r
37   in the configure.in file\r
38 \r
39   Caution: the language code may differ from the country\r
40   code, e.g. czech language is cs, Czech Republic is cz \r
41 \r
42 - run autoconf to recreate configure script\r
43 \r
44 - reconfigure the package (./configure)\r
45 \r
46 - in the po directory, copy gnokii.pot to <country>.po\r
47 \r
48 - start translating\r
49   \r
50 \r
51 3.2 How to merge existing translations with the updated gnokii.pot?\r
52 \r
53 This is simple. Rename the old file and use msgmerge to create\r
54 an updated one:\r
55 \r
56         mv cs.po cs.po.bak\r
57         msgmerge -o cs.po cs.po.bak gnokii.pot\r
58 \r
59 \r
60 4. How to generate a .mo file\r
61 \r
62 When you say make in the po directory, all existing\r
63 translations will be generated. The suffix will be .gmo.\r
64 \r
65 If you want to do this manually, use the msgfmt utility, e.g.\r
66 \r
67         msgfmt -o cs.mo -v cs.po \r
68 \r
69 \r
70 5. How to install the files\r
71 \r
72 Again, the makefile takes care of this. Simply use (as root)\r
73 \r
74         make install\r
75 \r
76 in the po directory. If you want to do this manually (and/or\r
77 for your language only), move the .mo file to\r
78 /usr/share/locale/<your locale>/LC_MESSAGES/gnokii.mo \r
79 \r
80 \r
81 I'm from Czech republic, so I did (well, I did not, but if you would\r
82 like to localize gnokii, you should :-):\r
83 \r
84         cd po\r
85         make gnokii.pot\r
86         cp gnokii.pot cs.po\r
87         <translating messages in cs.po>\r
88         <checking the translations using> msgfmt -o cs.mo -v cs.po\r
89         make\r
90         make install\r
91 \r
92 And now:\r
93 \r
94 SnowWhite:/tmp/gnokii$ export LC_MESSAGES=cs_CZ\r
95 SnowWhite:/tmp/gnokii$ ./gnokii --version\r
96 GNOKII Version 0.3.1 Copyright (C) Hugh Blemings 1999. <hugh@linuxcare.com>\r
97         Kompilace: 19:09:02 Mar 13 1999 pro model 6110 na portu /dev/ttyS0 \r
98 SnowWhite:/tmp/gnokii$ \r
99 \r
100 The second line is in czech language :-) There are some problems - for\r
101 example with "Mar" which is substitute by the C preprocessor.\r
102 \r