Bug 988614

Summary: RFE: Additional .po file error checking
Product: [Retired] Zanata Reporter: Isaac Rooskov <irooskov>
Component: Component-PythonClientAssignee: Michelle Kim <mkim>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: damason, dchen, msuchy, yshao, zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-31 01:16:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Isaac Rooskov 2013-07-26 00:52:48 UTC
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-13 02:02:11 UTC
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-26 01:32:12 UTC
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-14 00:21:22 UTC
Reassigned to PM

Comment 7 Zanata Migrator 2015-07-31 01:16:14 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-392

Comment 8 Red Hat Bugzilla 2023-09-14 01:48:26 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days