Red Hat Bugzilla – Bug 988614
RFE: Additional .po file error checking
Last modified: 2015-08-06 01:55:11 EDT
Description of problem:
From Miroslav Suchy on Memo-list:
I'm refering to .po files and they content. They very often contains errors. Some of them are quite trivial as:
1544: `msgid' and `msgstr' entries do not both end with '\n'
but some of there are fatal - eg. %s in source is replaced with %d in translation or different numbers of %s in sources and in translations, which can lead to runtime errors.
I never received such errors from Transifex, but I always get them from Zanata (my last experience is 6 moths old). It would be awesome if Zanata can do:
msgfmt -c *.po
Additionally if Zanata can do:
pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines -t options -t printf -t validchars --gnome
or even enable endwhitespace, endpunc, puncspacing checking that would be very awesome.
Zanata has validators that run in the editor for the two examples given, as well as several others. Default validations for projects and versions can be set in the Edit Project and Edit Version pages respectively (or during project or version creation).
The validations currently cause errors to be shown in the editor, but do not prevent saving of invalid strings. I recommend that we allow validations for each project to be set to 'off by default', 'on by default' or 'required' so that project maintainers can ensure that invalid strings cannot be saved, but allow translators to configure the non-essential validations to suit their workflow.
Validators for each of the cases listed could be added to Zanata - individual validators generally do not take a lot of effort to add, particularly with reference to the implementation in msgfmt.
This bug should be addressed in 2 places:
1) When pushing and upload
What should we do for the po files that's failed the checking?
a) Reject the whole file
or b) Skip the invalid entry
2) When translating
I think zanata translation editor, like mentioned in comment #1, show warning in the editor, is that sufficient?
Reassigned to PM
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-392