Closed Bug 747911 Opened 12 years ago Closed 12 years ago

Add plural rule for Breton (br)

Categories

(Core :: Internationalization: Localization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: mnedeleg, Assigned: mnedeleg)

Details

Attachments

(1 file, 1 obsolete file)

Since we started the breton localization, we use only 2 plural forms which is accepted but it would be more correct if we could use the following plural rules:
- Form 1 for numbers that ends with 1 (except those ending with 11,71,91)
- Form 2 for numbers that ends with 2 (except those ending with 12,72,92)
- Form 3 for numbers that ends with 3, 4 or 9 (except those ending with 13,14,19,73,74,79,93,94,99)
- Form 4 for numbers that ends with 1 000 000
- Form 5 for the other numbers

You can find the same rule in the Unicode repository (though the form 3 is written differently) :
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html

Would it be possible to add this plural rule to Mozilla products ?
I have looked at the existing rules at the following URL but there is nothing that match the breton one:
https://developer.mozilla.org/en/Localization_and_Plurals

I have made some tests with a PO file with the rule below.
The format seems to be the same as the one used in intl/locale/src/PluralForm.jsm

Plural-Forms: nplurals=5; plural=n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:(n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:n%1000000==0&&n!=0?3:4;
Attached patch Patch for PluralForm.jsm (obsolete) — Splinter Review
Attachment #620349 - Flags: review?(l10n)
Comment on attachment 620349 [details] [diff] [review]
Patch for PluralForm.jsm

Review of attachment 620349 [details] [diff] [review]:
-----------------------------------------------------------------

This will need to have tests, too. Also, is this the same form as http://unicode.org/cldr/trac/ticket/2886#comment:9 ? Didn't dive into the details, but I'd like to make sure if we're doing the same thing or something differing.
Attachment #620349 - Flags: review?(l10n) → review-
We're doing the same thing.
The following link mentions the bug 2886 you gave in comment 2 :
http://unicode.org/cldr/trac/browser/trunk/common/supplemental/plurals.xml#L97
And the rules are the same as the one i use.
I added a test for the breton rule to the file intl/locale/tests/unit/test_pluralForm.js.
But I didn't manage to run this test.
How can I do that ?
Attachment #620349 - Attachment is obsolete: true
Attachment #623403 - Flags: review?(l10n)
Comment on attachment 623403 [details] [diff] [review]
Patch for PluralForm.jsm and test_pluralForm.js

Review of attachment 623403 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the late response. You run the tests in a build with --enable-tests, and then from the top-level object directory,

make SOLO_FILE="test_pluralForm.js" -C intl/locale/tests/ check-one

https://developer.mozilla.org/en/Writing_xpcshell-based_unit_tests#Your_first_xpcshell-based_test has more info.

I'm cancelling the review request for now, feel free to re-request once you've successfully run the tests.
Attachment #623403 - Flags: review?(l10n)
Comment on attachment 623403 [details] [diff] [review]
Patch for PluralForm.jsm and test_pluralForm.js

I run the test and everything works fine with the plural rule I have added.
You can review the patch.
Attachment #623403 - Flags: review?(l10n)
Comment on attachment 623403 [details] [diff] [review]
Patch for PluralForm.jsm and test_pluralForm.js

Review of attachment 623403 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me, requesting review from Simon, too.
Attachment #623403 - Flags: review?(smontagu)
Attachment #623403 - Flags: review?(l10n)
Attachment #623403 - Flags: review+
Attachment #623403 - Flags: review?(smontagu) → review+
Flagging for check-in. Michel, to make landing of future patches easier, mind checking out https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in on a few technical steps that save our landing heros some time?
Keywords: checkin-needed
Thanks you, Axel!
I will take care of that if I have to do patches in the future.
Assignee: nobody → mnedeleg
https://hg.mozilla.org/integration/mozilla-inbound/rev/aba4c340a437

Thanks for the patch, Michel! Sorry for the delay getting it checked in.
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/aba4c340a437
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: