Merge POs using --previous

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

Post Reply
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Merge POs using --previous

Post by caslav.ilic »

Since Gettext 0.16, msgmerge has a nifty feature, enabled by the --previous option: when making a fuzzy match, it also adds the special comment containing the previous msgid field (the one for which the translation was made). For example:

Code: Select all

#: data/core/units/humans/Woodsman_Trapper.cfg:21
#, fuzzy
#| msgid ""
#| "Master woodsmen are useful allies to any army, and indispensable for any "
#| "sizable group of bandits. They can track both man and beast, notice "
#| "things most others would overlook, and are often the only ones who can "
#| "find food for the table, be it animal or vegetable.\n"
#| "\n"
#| "Their skill at hunting is very useful in combat, and also leaves them "
#| "unusually competent at night, and in forests and swamps."
msgid ""
"Master woodsmen are useful allies to any army, and indispensable for any "
"sizable group of people living in the wilderness. They can track both man "
"and beast, notice things most others would overlook, and are often the only "
"ones who can find food for the table, be it animal or vegetable.\n"
"\n"
"Their skill at hunting is very useful in combat, and also leaves them "
"unusually competent at night, and in forests and swamps."
msgstr ""
This enables the translator to "see" what was the exact change in msgid, and rework the msgstr accordingly. However, when put just like that, the translator may need as much time to compare the old and new msgid, as to compare the current msgid and old msgstr -- yielding seemingly no gain.

Instead, the feature really shines when the translation tool knows how to make a diff of old and new msgid fields. Of the dedicated PO editors, present releases of e.g. GTranslator, KBabel, and POedit cannot do this, but KDE4's Lokalize (KBabel replacement) does make such diffs. Here is a (stripped-down) screenshot of Lokalize, note the Original Diff pane at the bottom:
lokalize-original-diff-01.png
There are also, I think, diff scripts floating around that can embed the diff in the old msgid, such to make it conspicuous to the translator using a general text editor. An example of Kwrite/Kate looking at one such embedded diff (and supporting with some syntax highlighting):
kwrite-po-syntax-diff-01.png
What are the downsides? More screen real-estate is consumed for the people using general text editors, and not having any auto-diff to make up to it. There is a possibility of general confusion, "what the heck is this now?". Can't think of technical problems though. For example, if only the fuzzy flag is removed and the old msgid (the #| comment) remains, e.g. what the the above mentioned diff-oblivious PO editors will do, msgmerge will remove it on the next run.

Go, no go?
Chusslove Illich (Часлав Илић)
torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Re: Merge POs using --previous

Post by torangan »

Last time we tried this too many distributions still had older versions of gettext causing some problems. Don't know how it's today, I'm using gentoo unstable and thus am on the bleeding edge.
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Merge POs using --previous

Post by caslav.ilic »

Indeed, in the patch I've meant to propose should we go with this, I've added a requirement for msgmerge to know about the --previous option. So the build would fail with Gettext older than 0.16. But it shouldn't matter for translators, as they don't merge.

Having said that, 0.16 has been released in October 2006...
Chusslove Illich (Часлав Илић)
User avatar
ivanovic
Lord of Translations
Posts: 1149
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Re: Merge POs using --previous

Post by ivanovic »

The problem is that the comment does create problems at *compile time* when gettext <0.16 is installed. That is for example OSX when compiling via terminal has this problem, since the latest version of gettext available there is 0.15.3 via fink, don't know about the other ways.

In general this is a *great* idea, which is why we directly added it after Rhonda proposed it. The problem was just that compiling was impossible for some users due to this addition. If it was just about requiring it for merging this would really no problem IMO, but it seems to be more of a problem when compiling. Sad but true...
caslav.ilic
Translator
Posts: 61
Joined: February 5th, 2007, 4:17 pm
Location: Brunswick, Germany

Re: Merge POs using --previous

Post by caslav.ilic »

Right, then best let some more time pass.

This thread can also be a reminder of the feature, and whoever would like to have it right now, can keep outside-SVN local copy of the catalogs and merge them manually; not exactly an arduous undertaking.

Speaking of reminders, lest I come up with another idea oblivious of it having being discussed already: did I missearch the forum for the previous talk on this, or missed a source to search? :)
Chusslove Illich (Часлав Илић)
torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Re: Merge POs using --previous

Post by torangan »

I guess you'd have to search the archives of #wesnoth-dev over at irclog.wesnoth.org which would be quite a task. :lol2:
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp

Translators for all languages required: contact me. No geek skills required!
Post Reply