2004-05-04 08:27:20 +00:00
|
|
|
wxWidgets translator guide
|
2000-03-07 10:53:53 +00:00
|
|
|
==========================
|
|
|
|
|
2004-05-04 08:27:20 +00:00
|
|
|
This note is addressed to wxWidgets translators.
|
2000-03-07 10:53:53 +00:00
|
|
|
|
|
|
|
First of all, here is what you will need:
|
|
|
|
|
|
|
|
1. GNU gettext package version 0.10.35 or later (NB: earlier versions were
|
|
|
|
known to have serious bugs)
|
|
|
|
|
2002-07-03 15:01:26 +00:00
|
|
|
a) for Unix systems you can download gettext-0.10.tar.gz from any GNU
|
|
|
|
mirror (RPMs and DEBs are also available from the usual places)
|
2000-03-07 10:53:53 +00:00
|
|
|
|
2002-07-03 15:01:26 +00:00
|
|
|
b) for Windows you can download the precompiled binaries from
|
2004-10-22 19:15:35 +00:00
|
|
|
www.wxwidgets.org or install PoEdit (poedit.sourceforge.net) and
|
2003-11-18 16:37:11 +00:00
|
|
|
add <installdir>/poEdit/bin to your path (so it can find xgettext).
|
2000-03-07 10:53:53 +00:00
|
|
|
|
|
|
|
2. A way to run a program recursively on an entire directory from the command
|
|
|
|
line:
|
|
|
|
|
2002-07-03 15:01:26 +00:00
|
|
|
a) for Unix systems, this is done in locale/Makefile using the standard find
|
|
|
|
command and xargs which is installed on almost all modern Unices. If you
|
|
|
|
are unlucky enough to not have xargs, you can use the -exec option of find
|
2000-03-07 10:53:53 +00:00
|
|
|
instead.
|
|
|
|
|
2003-11-18 16:37:11 +00:00
|
|
|
b) for Win32 systems you can use either Cygwin or MinGW. If you don't have
|
|
|
|
those it is less trivial: if you have 4DOS/4NT/bash, that's
|
2000-03-07 10:53:53 +00:00
|
|
|
fine, but you'd have to use some kind of "for /s" loop with the
|
|
|
|
command.com/cmd.exe.
|
|
|
|
|
|
|
|
3. (at least read) access to the cvs is not necessary strictly speaking, but
|
2003-11-18 16:37:11 +00:00
|
|
|
will make things a lot easier for you and others.
|
2000-03-07 10:53:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
Now a brief overview of the process of translations (please refer to GNU
|
|
|
|
gettext documentation for more details). It happens in several steps:
|
|
|
|
|
|
|
|
1. the strings to translate are extracted from the C++ sources using xgettext
|
2007-11-12 10:12:49 +00:00
|
|
|
program into a wxstd.pot file which is a "text message catalog"
|
2000-03-07 10:53:53 +00:00
|
|
|
|
2007-11-12 10:12:49 +00:00
|
|
|
2. this new wxstd.pot file (recreated each time some new text messages are added
|
2004-05-04 08:27:20 +00:00
|
|
|
to wxWidgets) is merged with existing translations in another .po file (for
|
2000-03-07 10:53:53 +00:00
|
|
|
example, de.po) and replaces this file (this is done using the program
|
|
|
|
msgmerge)
|
|
|
|
|
|
|
|
3. the resulting .po file must be translated
|
|
|
|
|
|
|
|
4. finally, msgformat must be run to produce a .mo file: "binary message catalog"
|
|
|
|
|
|
|
|
|
2003-11-18 16:37:11 +00:00
|
|
|
How does it happen in practice? There is a Makefile in the "locale"
|
|
|
|
directory which will do almost everything (except translations) for you. i.e.
|
2000-03-07 10:53:53 +00:00
|
|
|
just type "make lang.po" to create or update the message catalog for 'lang'.
|
|
|
|
Then edit the resulting lang.po and make sure that there are no empty or fuzzy
|
2002-07-03 15:01:26 +00:00
|
|
|
translations left (empty translations are the ones with msgstr "", fuzzy
|
2000-03-07 10:53:53 +00:00
|
|
|
translations are those which have the word "fuzzy" in a comment just above
|
|
|
|
them). Then type "make lang.mo" which will create the binary message catalog.
|
|
|
|
|
2003-11-18 16:37:11 +00:00
|
|
|
Under Windows (If you don't have Cygwin or MinGW), you should execute the
|
|
|
|
commands manually, please have a look at Makefile to see what must be done.
|
2000-03-07 10:53:53 +00:00
|
|
|
|
2005-08-12 15:29:57 +00:00
|
|
|
For platform specific translations, .po files such as 'locale/msw/it.po' can be
|
|
|
|
used to provide translations that override the usual ones in 'locale/it.po'.
|
2005-08-12 15:34:01 +00:00
|
|
|
The generated .mo files are then installed under the names such as 'wxmsw.mo'
|
2005-08-12 15:29:57 +00:00
|
|
|
alongside the generic 'wxstd.mo'.
|
|
|
|
|
|
|
|
A new platform specific translation should be added to a section such as this
|
|
|
|
in wx.bkl:
|
|
|
|
|
|
|
|
<gettext-catalogs id="locale_msw">
|
|
|
|
<srcdir>$(SRCDIR)/locale/msw</srcdir>
|
|
|
|
<catalog-name>wxmsw</catalog-name>
|
|
|
|
<linguas>it</linguas>
|
|
|
|
<install-to>$(LOCALEDIR)</install-to>
|
|
|
|
</gettext-catalogs>
|
|
|
|
|
2000-03-07 10:53:53 +00:00
|
|
|
=== EOF ===
|
|
|
|
|
|
|
|
Author: VZ
|
|
|
|
Version: $Id$
|
|
|
|
|
|
|
|
$Log$
|
2005-08-12 15:34:01 +00:00
|
|
|
Revision 1.7 2005/08/12 15:34:01 MW
|
|
|
|
Typo
|
|
|
|
|
2005-08-12 15:29:57 +00:00
|
|
|
Revision 1.6 2005/08/12 15:29:47 MW
|
|
|
|
Translate '&Help' to '&' for italian Windows only
|
|
|
|
|
2004-10-22 19:15:35 +00:00
|
|
|
Revision 1.5 2004/10/22 19:12:59 KH
|
|
|
|
*** empty log message ***
|
|
|
|
|
2004-05-04 08:27:20 +00:00
|
|
|
Revision 1.4 2004/05/04 08:26:58 JS
|
|
|
|
Name change replacements
|
|
|
|
|
2003-11-18 16:37:11 +00:00
|
|
|
Revision 1.3 2003/11/18 16:37:11 DS
|
|
|
|
Updated translation technote to mention Makefile usage under Windows.
|
|
|
|
|
2002-07-03 15:01:26 +00:00
|
|
|
Revision 1.2 2002/07/03 15:01:26 VZ
|
|
|
|
typos and other doc corrections from Olly Betts (patch 573738)
|
|
|
|
|
2000-03-07 10:53:53 +00:00
|
|
|
Revision 1.1 2000/03/07 10:53:53 VZ
|
|
|
|
technote about translations added
|
|
|
|
|