krita_xgettext.sh: Fix modification of multiline msgctxt tags
ClosedPublic

Authored by aspotashev on Mar 23 2016, 6:48 AM.

Details

Summary

For a message like this:

msgctxt ""
"context string"
msgid "original text"

the former code changed the msgctxt and also added

msgctxt "(qtundo-format)"

because it did not find the existing msgctxt on the previously line
w.r.t. msgid.

To fix the problem, we additionally check:

lastLine !~ /^"/

Thanks to Luigi Toscano for noticing and for his patch that does
basically the same.

CCMAIL: luigi.toscano@tiscali.it

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aspotashev updated this revision to Diff 2914.Mar 23 2016, 6:48 AM
aspotashev retitled this revision from to krita_xgettext.sh: Fix modification of multiline msgctxt tags.
aspotashev updated this object.
aspotashev edited the test plan for this revision. (Show Details)
aspotashev added reviewers: rempt, ltoscano.
rempt accepted this revision.Mar 23 2016, 11:46 AM
rempt edited edge metadata.

Please go ahead -- I can't read perl, but I trust that you and Luigi know what you're doing. Better than me, in any case.

This revision is now accepted and ready to land.Mar 23 2016, 11:46 AM
ltoscano edited edge metadata.Mar 23 2016, 11:02 PM

Thanks for the patch - my initial proposal had a limited scope.
This fixes the error of multiline msgctxt tags, but now I still have some problems and I don't understand the reason.

When I run
path/to/trunk/l10n-kf5/scripts/extract-messages.sh
I get a file with 10263 messages, with still messages repeated twice (with and without context). while the example you told me about previously had 5273 messages. The script extract-messages.sh is untouched and the checkout of krita is clean + the patch above. Do you have an idea of what else I should check or that could influence the generation?

When I run
path/to/trunk/l10n-kf5/scripts/extract-messages.sh
I get a file with 10263 messages, with still messages repeated twice (with and without context). while the example you told me about previously had 5273 messages. The script extract-messages.sh is untouched and the checkout of krita is clean + the patch above. Do you have an idea of what else I should check or that could influence the generation?

Investigating with Alexander on IRC, we found out that this is a different issue with the version of on my system. All versions of xgettext >=0.19.6 enables default KDE keywords when "C++ with KDE" is analyzed, see:

https://lists.gnu.org/archive/html/info-gnu/2015-07/msg00004.html

This is not a concern right now because rosetta (the system where scripty runs) has xgettext 0.18.1, but it is something to track.

This patch can go in in the meantime, as it does not change the status quo for this new issue but it fixes the invalid gettext files.

ltoscano accepted this revision.Mar 24 2016, 10:38 PM
ltoscano edited edge metadata.
This revision was automatically updated to reflect the committed changes.