Bug 988614 - RFE: Additional .po file error checking [NEEDINFO]
RFE: Additional .po file error checking
Product: Zanata
Classification: Community
Component: Component-PythonClient (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Michelle Kim
Zanata-QA Mailling List
Depends On:
  Show dependency treegraph
Reported: 2013-07-25 20:52 EDT by Isaac Rooskov
Modified: 2015-08-06 01:55 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-07-30 21:16:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
dchen: needinfo? (irooskov)

Attachments (Terms of Use)

  None (edit)
Description Isaac Rooskov 2013-07-25 20:52:48 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.
Comment 1 David Mason 2013-08-12 22:02:11 EDT
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.
Comment 2 Ding-Yi Chen 2014-03-25 21:32:12 EDT
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?
Comment 6 Damian Jansen 2015-07-13 20:21:22 EDT
Reassigned to PM
Comment 7 Zanata Migrator 2015-07-30 21:16:14 EDT
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-392

Note You need to log in before you can comment on or make changes to this bug.