Bug 1002772

Summary: Source string with translation changed plural will cause pull failure
Product: [Retired] Zanata Reporter: Patrick Huang <pahuang>
Component: Component-zanata-clientAssignee: Patrick Huang <pahuang>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.0CC: dchen, sflaniga
Target Milestone: ---   
Target Release: 3.1   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: zanata-cli-3.1.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 03:25:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Patrick Huang 2013-08-30 00:31:59 UTC
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 08:02:09 UTC
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-03 00:02:10 UTC
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-03 01:06:02 UTC
maven client option will be -Dzanata.continueAfterError

Comment 5 Ding-Yi Chen 2013-09-23 00:06:57 UTC
VERIFIED with Zanata version 3.0.4-SNAPSHOT (20130923-0021)
 and zanata-cli-3.1.2

Comment 6 Sean Flanigan 2013-11-27 03:16:11 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 7 Sean Flanigan 2013-11-27 03:17:12 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 8 Sean Flanigan 2013-11-27 03:19:32 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 9 Sean Flanigan 2013-11-27 03:25:30 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 10 Sean Flanigan 2013-11-27 03:34:19 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.

Comment 11 Sean Flanigan 2013-11-27 03:36:28 UTC
Closing VERIFIED bugs for Zanata versions <= 3.1.