Bug 1002772 - Source string with translation changed plural will cause pull failure
Source string with translation changed plural will cause pull failure
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-zanata-client (Show other bugs)
3.0
Unspecified Linux
unspecified Severity medium
: ---
: 3.1
Assigned To: Patrick Huang
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-29 20:31 EDT by Patrick Huang
Modified: 2013-11-26 22:36 EST (History)
2 users (show)

See Also:
Fixed In Version: zanata-cli-3.1.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-26 22:25:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Patrick Huang 2013-08-29 20:31:59 EDT
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
Build Identifier: 

Example:
A source string in plural form gets translated in a language with 2 plurals.
It then changed to singular form. The second translated string will still sit in database and when pulling, that second string will be attempted to be written out and cause an error in client (if download from UI it will silently fail and output a halfway file). 

Reproducible: Always

Steps to Reproduce:
1. Push a pot with one string in plural form
2. Pick a language that supports plural > 1
3. Translate the string and save
4. Change the pot and make the string singular
5. Pull from server
Actual Results:  
Caused by: java.lang.RuntimeException: plural forms not enabled for this text flow: resId=af6517b78862e0ad1739e91f2daa35ba
	at org.zanata.adapter.po.PoWriter2.copyTFTContentsToMessage(PoWriter2.java:430)
	at org.zanata.adapter.po.PoWriter2.write(PoWriter2.java:306)
	at org.zanata.adapter.po.PoWriter2.writePoToFile(PoWriter2.java:206)


Expected Results:  
Ignore the unused plural translation and maybe give a warning
Comment 2 Sean Flanigan 2013-08-30 04:02:09 EDT
I think the relaxed data check should be optional, only enabled when it is needed (eg server returns inconsistent data).  Failing the pull process is an important sign that something is wrong.
Comment 3 Patrick Huang 2013-09-02 20:02:10 EDT
added new option --continue-after-error or -c to enable client continue on this plural error.
client commit:
https://github.com/zanata/zanata-client/commit/a75cbd3ccc77c3f1c5386a528a963f4aef7488f4

common commit:
https://github.com/zanata/zanata-common/commit/2ad7a70050e5037d88bb18b2636448698edf8275
Comment 4 Patrick Huang 2013-09-02 21:06:02 EDT
maven client option will be -Dzanata.continueAfterError
Comment 5 Ding-Yi Chen 2013-09-22 20:06:57 EDT
VERIFIED with Zanata version 3.0.4-SNAPSHOT (20130923-0021)
 and zanata-cli-3.1.2
Comment 6 Sean Flanigan 2013-11-26 22:16:11 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.
Comment 7 Sean Flanigan 2013-11-26 22:17:12 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.
Comment 8 Sean Flanigan 2013-11-26 22:19:32 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.
Comment 9 Sean Flanigan 2013-11-26 22:25:30 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.
Comment 10 Sean Flanigan 2013-11-26 22:34:19 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.
Comment 11 Sean Flanigan 2013-11-26 22:36:28 EST
Closing VERIFIED bugs for Zanata versions <= 3.1.

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