Add support for multiple tags in XmlMessages.sh
AbandonedPublic

Authored by stikonas on Oct 25 2020, 6:34 PM.

Details

Reviewers
aacid
Summary

Tags are extracted from XML files and stored in msgctxt entry of pot file.

This will invalidate existing translations but there aren't too many of them (only 20 very small files).

Test Plan

Tested extraction with extract-xml script with two tags (message, description).
Created one po file corresponding to pot file.
Injected translation back by running python fillxmlfrompo.py ~/repositories/kde/kpmcore/src/util/org.kde.kpmcore.externalcommand.policy ~/repositories/kde/kpmcore/src/po kpmcore kpmcore._policy_.po

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
stikonas requested review of this revision.Oct 25 2020, 6:34 PM
stikonas created this revision.
stikonas added inline comments.Oct 25 2020, 6:45 PM
fillxmlfrompo.py
47

This should read presenttagindices

stikonas marked an inline comment as done.Oct 25 2020, 6:46 PM
stikonas added inline comments.Oct 25 2020, 6:59 PM
extract-xml.sh
18

echo "Failed to change directory into $subdir"

stikonas updated this revision to Diff 83372.Oct 25 2020, 6:59 PM
stikonas marked an inline comment as done.
stikonas updated this revision to Diff 83373.EditedOct 25 2020, 7:14 PM

Get rid of find_tags function since it introduces scoping problems (main program body in this file is not scoped)

aacid added inline comments.Oct 25 2020, 11:21 PM
fillxmlfrompo.py
22

should nbot this be templates/messages instead of templates?

Shouldn't the
if entry.msgid == msgid:
now also have some kind of msgctxt checking?

stikonas marked an inline comment as done.Oct 25 2020, 11:23 PM
stikonas added inline comments.
fillxmlfrompo.py
22

Indeed. And my local testing of course wasn't able to catch this, because I created new directory structure. Thanks for spotting.

stikonas marked 2 inline comments as done.Oct 25 2020, 11:25 PM

Shouldn't the
if entry.msgid == msgid:
now also have some kind of msgctxt checking?

Yeah, I think I should add some context checking.

stikonas updated this revision to Diff 83374.Oct 25 2020, 11:29 PM

Address review comments.

Looks good to me.

stikonas abandoned this revision.Oct 26 2020, 12:12 AM