From bbd7cb2d3add1e4dd6d6ec8e5bbda16fee2ed2a5 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Thu, 21 Jan 2021 13:40:59 +0200 Subject: [PATCH 1/5] Fix translation docs: -c is the important gettext switch, not -v -c does the crucial syntax/format checking, -v is just verbose. --- docs/doxygen/mainpages/translations.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/doxygen/mainpages/translations.h b/docs/doxygen/mainpages/translations.h index 643cc47abf..37f235e495 100644 --- a/docs/doxygen/mainpages/translations.h +++ b/docs/doxygen/mainpages/translations.h @@ -459,8 +459,8 @@ Here are the steps you should follow: editor or a specialized tool such as Vaclav Slavik's excellent poEdit utility. -# Verify that your translations can at least be compiled (even if they - are yet incomplete) by running msgfmt -v XY.po command: - please note that you must use the -v option. In + are yet incomplete) by running msgfmt -vc XY.po command: + please note that you must use the -c option. In particular, please fill the header fields because @c msgfmt doesn't accept the default values for them. -# Send the finished translation to Vadim Zeitlin From b78c61af84f391c2af1d10678a24f091b74a0ad4 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Thu, 21 Jan 2021 13:41:07 +0200 Subject: [PATCH 2/5] Translation docs update: don't recommend 20-year-old gettext; use msginit Warning about gettext versions earlier than 0.10.35 is pointless, as even 0.10.35 is from 2001, and so old it isn't even available on GNU mirrors anymore. We shall not recommend a specific version in the first place. The proper way to start a new translation is to use msginit to initialize a .po file -- just copying the .pot leaves many fields to their default values, which the translator would need to fill in manually (the Plural-Forms: field in particular). --- docs/contributing/translators-guide.md | 5 ++--- docs/doxygen/mainpages/translations.h | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/contributing/translators-guide.md b/docs/contributing/translators-guide.md index dfd67544f8..013db04f81 100644 --- a/docs/contributing/translators-guide.md +++ b/docs/contributing/translators-guide.md @@ -5,10 +5,9 @@ This note is addressed to wxWidgets translators. 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) +1. GNU gettext package - a) for Unix systems you can download gettext-0.10.tar.gz from any GNU + a) 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) b) for Windows you can download the precompiled binaries from diff --git a/docs/doxygen/mainpages/translations.h b/docs/doxygen/mainpages/translations.h index 37f235e495..5cf8e66664 100644 --- a/docs/doxygen/mainpages/translations.h +++ b/docs/doxygen/mainpages/translations.h @@ -452,9 +452,11 @@ Here are the steps you should follow: you should already have it. Otherwise you can always retrieve it directly from the git repository: locale/wxstd.pot. --# Rename it to XY.po where "XY" is the 2 letter +-# Initialize an XY.po file for your language by using the command + msginit -l XY in the same folder where you placed wxstd.pot. + The "XY" is the 2 letter ISO 639-2 language code - for your language. + for your language. Initialization can be also done using e.g. Poedit (see next item). -# Translate the strings in this file using either your favourite text editor or a specialized tool such as Vaclav Slavik's excellent poEdit utility. From f7514362ba189c935434941b04385581b3d6ae4d Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Thu, 21 Jan 2021 13:41:11 +0200 Subject: [PATCH 3/5] More accurately describe wxstd.pot update schedule Git log shows that wxstd.pot was not updated at all in e.g. 2020, 2019, 2018, 2016. --- docs/contributing/translators-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/translators-guide.md b/docs/contributing/translators-guide.md index 013db04f81..89422b5a74 100644 --- a/docs/contributing/translators-guide.md +++ b/docs/contributing/translators-guide.md @@ -37,7 +37,7 @@ gettext documentation for more details). It happens in several steps: 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" -2. this new wxstd.pot file (recreated each time some new text messages are added +2. this new wxstd.pot file (recreated every 1-4 years even if new messages were added to wxWidgets) is merged with existing translations in another .po file (for example, de.po) and replaces this file (this is done using the program msgmerge) From eae08b14c66778424f1f67d2517aa3ec4b63ad52 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Jan 2021 15:50:02 +0100 Subject: [PATCH 4/5] Amend the update schedule frequency from the last commit Even if wxstd.pot is updated infrequently now, we shouldn't document this as something normal or desirable. --- docs/contributing/translators-guide.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/contributing/translators-guide.md b/docs/contributing/translators-guide.md index 89422b5a74..017140413d 100644 --- a/docs/contributing/translators-guide.md +++ b/docs/contributing/translators-guide.md @@ -37,10 +37,10 @@ gettext documentation for more details). It happens in several steps: 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" -2. this new wxstd.pot file (recreated every 1-4 years even if new messages were added - to wxWidgets) is merged with existing translations in another .po file (for - example, de.po) and replaces this file (this is done using the program - msgmerge) +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 + file (this is done using the program msgmerge) 3. the resulting .po file must be translated From 7169056e913772438f3561d7f86a92d27505e428 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Jan 2021 15:55:14 +0100 Subject: [PATCH 5/5] Use Markdown formatting in the translation HOWTO Also update Poedit name (case) and URL and remove thoroughly obsolete references to 4DOS. --- docs/contributing/translators-guide.md | 47 +++++++++++--------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/docs/contributing/translators-guide.md b/docs/contributing/translators-guide.md index 017140413d..5814259eb0 100644 --- a/docs/contributing/translators-guide.md +++ b/docs/contributing/translators-guide.md @@ -7,25 +7,18 @@ First of all, here is what you will need: 1. GNU gettext package - a) 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) - - b) for Windows you can download the precompiled binaries from - www.wxwidgets.org or install PoEdit (poedit.sourceforge.net) and - add /poEdit/bin to your path (so it can find xgettext). + - 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 + `/poEdit/bin` to your path (so it can find xgettext). 2. A way to run a program recursively on an entire directory from the command line: - 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 - instead. - - 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 - fine, but you'd have to use some kind of "for /s" loop with the - command.com/cmd.exe. + - 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. 3. Access to the git repository is not necessary strictly speaking, but will make things a lot easier for you and others. @@ -34,34 +27,34 @@ First of all, here is what you will need: 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 - program into a wxstd.pot file which is a "text message catalog" +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" 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 - file (this is done using the program msgmerge) + 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" +4. finally, `msgformat` must be run to produce a .mo file: "binary message catalog" 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. -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 +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 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. +them). Then type `make lang.mo` which will create the binary message catalog. 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. -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'. -The generated .mo files are then installed under the names such as 'wxmsw.mo' -alongside the generic 'wxstd.mo'. +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`. +The generated .mo files are then installed under the names such as `wxmsw.mo` +alongside the generic `wxstd.mo`. A new platform specific translation should be added to a section such as this in wx.bkl: