Closed Bug 513993 Opened 15 years ago Closed 15 years ago

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

Categories

(addons.mozilla.org Graveyard :: Localization, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: Milos, Assigned: clouserw)

References

()

Details

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.
It's not pretty.  r50723
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Milos, is this verified?  Thanks!
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.
I added the proper plural-forms header in r51486.  The msgstr[] cases are as good as I can get them with the script.
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.
(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?
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
(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 → ---
(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.
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.
(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.
thanks, r52363
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
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.