2014-06-11 17:14:09 -04:00
|
|
|
wxWidgets translator guide
|
|
|
|
==========================
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
This note is addressed to wxWidgets translators.
|
|
|
|
|
|
|
|
First of all, here is what you will need:
|
|
|
|
|
2021-01-21 06:41:07 -05:00
|
|
|
1. GNU gettext package
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2021-01-21 09:55:14 -05:00
|
|
|
- For Unix systems you can download gettext-0.xx.yy.tar.gz from any GNU
|
|
|
|
mirror (RPMs and DEBs are also available from the usual places)
|
|
|
|
- For Windows you can download the precompiled binaries from
|
|
|
|
www.wxwidgets.org or install [Poedit](https://poedit.net/) and add
|
|
|
|
`<installdir>/poEdit/bin` to your path (so it can find xgettext).
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
2. A way to run a program recursively on an entire directory from the command
|
|
|
|
line:
|
|
|
|
|
2021-01-21 09:55:14 -05:00
|
|
|
- For Unix systems, this is done in `locale/Makefile` using the standard `find`
|
|
|
|
command and `xargs` which is installed on almost all modern Unices.
|
|
|
|
- For Win32 systems you can use Cygwin, MSYS or WSL.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2015-02-20 22:07:15 -05:00
|
|
|
3. Access to the git repository is not necessary strictly speaking, but will
|
|
|
|
make things a lot easier for you and others.
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
Now a brief overview of the process of translations (please refer to GNU
|
|
|
|
gettext documentation for more details). It happens in several steps:
|
|
|
|
|
2021-01-21 09:55:14 -05:00
|
|
|
1. the strings to translate are extracted from the C++ sources using `xgettext`
|
|
|
|
program into a `wxstd.pot` file which is a "text message catalog"
|
2014-06-11 17:14:02 -04:00
|
|
|
|
2021-01-21 09:50:02 -05:00
|
|
|
2. this new wxstd.pot file (which is updated from time to time by running
|
|
|
|
`make wxstd.pot` in the `locale` subdirectory) is merged with existing
|
|
|
|
translations in another .po file (for example, de.po) and replaces this
|
2021-01-21 09:55:14 -05:00
|
|
|
file (this is done using the program `msgmerge`)
|
2014-06-11 17:14:02 -04:00
|
|
|
|
|
|
|
3. the resulting .po file must be translated
|
|
|
|
|
2021-01-21 09:55:14 -05:00
|
|
|
4. finally, `msgformat` must be run to produce a .mo file: "binary message catalog"
|
2014-06-11 17:14:02 -04: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.
|
2021-01-21 09:55:14 -05: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
|
|
|
|
translations left (empty translations are the ones with `msgstr ""`, fuzzy
|
2014-06-11 17:14:02 -04:00
|
|
|
translations are those which have the word "fuzzy" in a comment just above
|
2021-01-21 09:55:14 -05:00
|
|
|
them). Then type `make lang.mo` which will create the binary message catalog.
|
2014-06-11 17:14:02 -04: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.
|