Convert old-style messages.po Serbian to meet new locales .po file

VERIFIED FIXED in 5.1

Status

addons.mozilla.org Graveyard
Localization
VERIFIED FIXED
9 years ago
2 years ago

People

(Reporter: Milos, Assigned: clouserw)

Tracking

unspecified

Details

(URL)

(Reporter)

Description

9 years ago
I have downloaded package with files to translate AMO. Now we use another type of localization of AMO, and this file I have worked on, isn't usable in it's current form. As per IRC, Wil said that he could try to merge old and new one, so we won't lose translated strings. Assigning this to Wil.

NOTE: File I was working on is at URI you can find in URL field of this bug.
(Assignee)

Comment 1

9 years ago
It's not pretty.  r50723
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Milos, is this verified?  Thanks!

Comment 3

9 years ago
FYI: A few concerns about this fix:

The file in question only uses two plural forms, I am only seeing msgstr[0] and msgstr[1].  Serbian has 3 plural forms (examples thereof: 1 man, 2 men, 5 people) and I would have expected to see msgstr[0], msgstr[1] and msgstr[2] that cover these cases, as well as a correct nplural expression describing them.

Second, the PO header file specifying among other things the nplurals expression is missing.  See: http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html for plurals for Serbian.
(Assignee)

Comment 4

9 years ago
I added the proper plural-forms header in r51486.  The msgstr[] cases are as good as I can get them with the script.
(Reporter)

Comment 5

9 years ago
Thanks for this awesome merge Wil!

Stephen, please give me a few days to check on it, and I'll QA it, if you don't mind doing so.
Milos, sure!
(In reply to comment #5)
> Thanks for this awesome merge Wil!
> 
> Stephen, please give me a few days to check on it, and I'll QA it, if you don't
> mind doing so.

Hi Milos; is this OK?
(Reporter)

Comment 8

9 years ago
The current file isn't perfect, because it has only 2 plural forms still. Anyhow, this was a godsend. Wil did what he could, so I do agree to add msgstr[2] to every plural, in order to save already translated strings. 

I don't think Filip will help in translation, so, AFAIC, this is verifed. 

NOTE: Filip, if you for some reason need to reopen this, please do, and we'll continue discussion.
Status: RESOLVED → VERIFIED

Comment 9

9 years ago
(In reply to comment #4)
> I added the proper plural-forms header in r51486.  The msgstr[] cases are as
> good as I can get them with the script.

Will, you added plural forms for Czech: 

Plural-Forms: nplurals=3; \
              plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;

This rule will produce, for example "22 порука" [original: 22 messages] (plural == 2), which is not correct Serbian. We expect "22 поруке", plural == 1, for correct Serbian.

The correct plural expression for Serbian is slightly more complex:
          Plural-Forms: nplurals=3; \
              plural=n%10==1 && n%100!=11 ? 0 : \
                     n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;

FYI, this will yield plural(n)== 0 for 1, 21, 31, 41 etc, plural(n) == 1 for 2, 3, 4, then 11, 12, ... 20, then 22, 23, 24; 32, 33, 34 etc, and plural(n) == 2 for 5 - 10, 25-30, etc.

I now see that the GNU page I pointed to is somewhat confusing in that it doesn't clearly state which formula applies to which language family.  The intended meaning is that the formula above applies to the languages given below. But it is fairly easy to read it the other way around, which apparently happened in this case.

Please correct this.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---

Comment 10

9 years ago
(In reply to comment #8)
> The current file isn't perfect, because it has only 2 plural forms still.
> Anyhow, this was a godsend. Wil did what he could, so I do agree to add
> msgstr[2] to every plural, in order to save already translated strings.

Your call, as you are the one signing off the QA of the Serbian locale for the website.

> I don't think Filip will help in translation, so, AFAIC, this is verifed. 
Milos is right here, unfortunately I can not set time aside to go in depth into website l10n at this point.  I'm trying to be instructive to Milos on things that are easy to see for a seasoned localizer.

> NOTE: Filip, if you for some reason need to reopen this, please do, and we'll
> continue discussion.

Reopened due to a technical issue, see Comment #9.  Feel free to ask for help if you need it, I'll do what I can to assist.
(Reporter)

Comment 11

9 years ago
Filip, I'm not much into .po files plural forms defining, so, will this do:

"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"?

That is one line.

Comment 12

9 years ago
(In reply to comment #11)
> Filip, I'm not much into .po files plural forms defining, so, will this do:
> 
> "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4
> && (n%100<10 || n%100>=20) ? 1 : 2;\n"?
> 
> That is one line.

If I see it correctly, you put the plural forms as a one-liner form of the multi-line nplurals expression from the gnu gettext page.  That should be OK.
(Assignee)

Comment 13

9 years ago
thanks, r52363
Status: REOPENED → RESOLVED
Last Resolved: 9 years ago9 years ago
Resolution: --- → FIXED
(Reporter)

Comment 14

9 years ago
Verified on SVN.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.