]>
Commit | Line | Data |
---|---|---|
fc2171bd | 1 | wxWidgets translator guide |
f077f5c3 VZ |
2 | ========================== |
3 | ||
fc2171bd | 4 | This note is addressed to wxWidgets translators. |
f077f5c3 VZ |
5 | |
6 | First of all, here is what you will need: | |
7 | ||
8 | 1. GNU gettext package version 0.10.35 or later (NB: earlier versions were | |
9 | known to have serious bugs) | |
10 | ||
552861bf VZ |
11 | a) for Unix systems you can download gettext-0.10.tar.gz from any GNU |
12 | mirror (RPMs and DEBs are also available from the usual places) | |
f077f5c3 | 13 | |
552861bf | 14 | b) for Windows you can download the precompiled binaries from |
dbd94b75 | 15 | www.wxwidgets.org or install PoEdit (poedit.sourceforge.net) and |
17a4e1f1 | 16 | add <installdir>/poEdit/bin to your path (so it can find xgettext). |
f077f5c3 VZ |
17 | |
18 | 2. A way to run a program recursively on an entire directory from the command | |
19 | line: | |
20 | ||
552861bf VZ |
21 | a) for Unix systems, this is done in locale/Makefile using the standard find |
22 | command and xargs which is installed on almost all modern Unices. If you | |
23 | are unlucky enough to not have xargs, you can use the -exec option of find | |
f077f5c3 VZ |
24 | instead. |
25 | ||
17a4e1f1 DS |
26 | b) for Win32 systems you can use either Cygwin or MinGW. If you don't have |
27 | those it is less trivial: if you have 4DOS/4NT/bash, that's | |
f077f5c3 VZ |
28 | fine, but you'd have to use some kind of "for /s" loop with the |
29 | command.com/cmd.exe. | |
30 | ||
4d636bdf | 31 | 3. (at least read) access to the subversion is not necessary strictly speaking, but |
17a4e1f1 | 32 | will make things a lot easier for you and others. |
f077f5c3 VZ |
33 | |
34 | ||
35 | Now a brief overview of the process of translations (please refer to GNU | |
36 | gettext documentation for more details). It happens in several steps: | |
37 | ||
38 | 1. the strings to translate are extracted from the C++ sources using xgettext | |
a2b18c57 | 39 | program into a wxstd.pot file which is a "text message catalog" |
f077f5c3 | 40 | |
a2b18c57 | 41 | 2. this new wxstd.pot file (recreated each time some new text messages are added |
fc2171bd | 42 | to wxWidgets) is merged with existing translations in another .po file (for |
f077f5c3 VZ |
43 | example, de.po) and replaces this file (this is done using the program |
44 | msgmerge) | |
45 | ||
46 | 3. the resulting .po file must be translated | |
47 | ||
48 | 4. finally, msgformat must be run to produce a .mo file: "binary message catalog" | |
49 | ||
50 | ||
17a4e1f1 DS |
51 | How does it happen in practice? There is a Makefile in the "locale" |
52 | directory which will do almost everything (except translations) for you. i.e. | |
f077f5c3 VZ |
53 | just type "make lang.po" to create or update the message catalog for 'lang'. |
54 | Then edit the resulting lang.po and make sure that there are no empty or fuzzy | |
552861bf | 55 | translations left (empty translations are the ones with msgstr "", fuzzy |
f077f5c3 VZ |
56 | translations are those which have the word "fuzzy" in a comment just above |
57 | them). Then type "make lang.mo" which will create the binary message catalog. | |
58 | ||
17a4e1f1 DS |
59 | Under Windows (If you don't have Cygwin or MinGW), you should execute the |
60 | commands manually, please have a look at Makefile to see what must be done. | |
f077f5c3 | 61 | |
4d931bcc MW |
62 | For platform specific translations, .po files such as 'locale/msw/it.po' can be |
63 | used to provide translations that override the usual ones in 'locale/it.po'. | |
8804b53f | 64 | The generated .mo files are then installed under the names such as 'wxmsw.mo' |
4d931bcc MW |
65 | alongside the generic 'wxstd.mo'. |
66 | ||
67 | A new platform specific translation should be added to a section such as this | |
68 | in wx.bkl: | |
69 | ||
70 | <gettext-catalogs id="locale_msw"> | |
71 | <srcdir>$(SRCDIR)/locale/msw</srcdir> | |
72 | <catalog-name>wxmsw</catalog-name> | |
73 | <linguas>it</linguas> | |
74 | <install-to>$(LOCALEDIR)</install-to> | |
75 | </gettext-catalogs> | |
76 | ||
f077f5c3 VZ |
77 | === EOF === |
78 | ||
79 | Author: VZ | |
f077f5c3 VZ |
80 | |
81 | $Log$ | |
8804b53f MW |
82 | Revision 1.7 2005/08/12 15:34:01 MW |
83 | Typo | |
84 | ||
4d931bcc MW |
85 | Revision 1.6 2005/08/12 15:29:47 MW |
86 | Translate '&Help' to '&' for italian Windows only | |
87 | ||
dbd94b75 KH |
88 | Revision 1.5 2004/10/22 19:12:59 KH |
89 | *** empty log message *** | |
90 | ||
fc2171bd JS |
91 | Revision 1.4 2004/05/04 08:26:58 JS |
92 | Name change replacements | |
93 | ||
17a4e1f1 DS |
94 | Revision 1.3 2003/11/18 16:37:11 DS |
95 | Updated translation technote to mention Makefile usage under Windows. | |
96 | ||
552861bf VZ |
97 | Revision 1.2 2002/07/03 15:01:26 VZ |
98 | typos and other doc corrections from Olly Betts (patch 573738) | |
99 | ||
f077f5c3 VZ |
100 | Revision 1.1 2000/03/07 10:53:53 VZ |
101 | technote about translations added | |
102 |