Bug 1197925 - RFE: Show Error "Plural-Forms in <locale>.po conflicts with server" when translator upload a po file that contain a different plural forms
Summary: RFE: Show Error "Plural-Forms in <locale>.po conflicts with server" when tran...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Logic
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Damian Jansen
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On: 1184708
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-03 00:49 UTC by Ding-Yi Chen
Modified: 2015-07-29 02:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1197927 (view as bug list)
Environment:
Last Closed: 2015-07-29 02:11:34 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1197927 0 unspecified CLOSED RFE: zanata-client should show Error "Plural-Forms in <locale>.po conflicts with server" when translator pushing a po fi... 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1197928 0 unspecified CLOSED RFE: zanata-python-client should show Error "Plural-Forms in <locale>.po conflicts with server" when translator pushing ... 2021-05-12 06:37:18 UTC

Internal Links: 1197927 1197928

Description Ding-Yi Chen 2015-03-03 00:49:28 UTC
Description of problem:
When a translator upload a po file that contains Plural-Forms that is different from server (e.g. Bug 1197283), it should show following error message and stop the process:

"Plural-Forms in <locale>.po conflicts with server"

This should depends on Bug 1184708, so admin can specify the correct plural form.

Version-Release number of selected component (if applicable):
Zanata 3.5.1 (git-server-3.5.1) 

How reproducible:
Always

Steps to Reproduce:
1. In web UI, Set the Plural-Form of kn to: nplurals=2; plural=(n != 1);
2. From anaconda project: https://fedora.zanata.org/project/view/anaconda
   Download the kn.po
3. Change the Plural-From in kn.po to "nplurals=1; plural=0;"
4. Upload kn.po

Actual results:
PluralsForm was updated to "nplurals=1; plural=0;"

Expected results:
Show error: "Plural-Forms in kn.po conflicts with server"

Additional info:

Comment 1 Sean Flanigan 2015-03-03 01:20:02 UTC
Zanata is meant to support per-file plural forms (for certain rare cases, including Chinese I seem to remember).  So I don't think this should be an error, but we should have a warning when this happens.  And if using this feature causes problems, they should probably be treated as bugs.

Also, bear in mind that the same plural rules can sometimes be specified in slightly different ways.

Comment 2 Sean Flanigan 2015-03-03 01:53:28 UTC
(In reply to Sean Flanigan from comment #1)
> Zanata is meant to support per-file plural forms (for certain rare cases,
> including Chinese I seem to remember).  So I don't think this should be an
> error, but we should have a warning when this happens.  And if using this
> feature causes problems, they should probably be treated as bugs.

Now that I think about it, those rare cases are probably so rare, especially in technical documents, as not to be worth the cost of supporting them properly in Zanata.  So perhaps it *should* be an error.  

If the problem comes up (eg someone has an old Arabic PO file with nplurals=5), it should not be difficult to write them a command-line script to migrate the PO file.

> Also, bear in mind that the same plural rules can sometimes be specified in
> slightly different ways.

Even so, the nplurals number should match, so we can check that.

Comment 3 Michelle Kim 2015-03-03 23:44:30 UTC
Hi Sean and Dean,

I agree that if it's very edge case that would rarely happens and if we are not going to implement anything in next 6 months to a year, I would rather save the resource and effort for some other bugs that are more urgent.
I can close this bug as DEFERRED so that when we have more resources available, we can take a look at it again if there's real error use cases reported. 

Please re-open the bug if you feel there is still need for any development effort. Thanks.

Comment 4 Ding-Yi Chen 2015-03-04 02:00:04 UTC
Michelle,

RFE Bug 1184708 is pretty much useless until we implement this.

The current behavior is, the plural form is from the uploaded/pushed po file.
and it downloads as-is. In other words, the server-wide plural form that Bug 1184708 implemented will not be used.

Comment 5 Sean Flanigan 2015-03-04 02:42:19 UTC
Supporting multiple plural forms for the same language is the rare edge case.  Getting bugs because of incorrect/mismatched plural forms is something which has already happened.

Checking nplurals should not be too difficult.

Dean, could you please add a link to the bug which occurred when a PO was uploaded with a bad value for nplurals?

Comment 6 Ding-Yi Chen 2015-03-04 03:28:45 UTC
(In reply to Sean Flanigan from comment #5)
> Supporting multiple plural forms for the same language is the rare edge
> case.  Getting bugs because of incorrect/mismatched plural forms is
> something which has already happened.
> Checking nplurals should not be too difficult.

Exactly, so that why I suggest error should be shown when someone trying to
push the "unofficial" plural-forms.

I also agree that checking nplurals should be sufficient on this stage.

> Dean, could you please add a link to the bug which occurred when a PO was
> uploaded with a bad value for nplurals?

Bug 1197283

Comment 7 Zanata Migrator 2015-07-29 02:11:34 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-147


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