Last Comment Bug 747911 - Add plural rule for Breton (br)
: Add plural rule for Breton (br)
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Localization (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Michel Nédélec
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-23 07:42 PDT by Michel Nédélec
Modified: 2012-06-09 19:43 PDT (History)
3 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch for PluralForm.jsm (617 bytes, patch)
2012-05-02 09:20 PDT, Michel Nédélec
l10n: review-
Details | Diff | Splinter Review
Patch for PluralForm.jsm and test_pluralForm.js (1.86 KB, patch)
2012-05-12 02:23 PDT, Michel Nédélec
l10n: review+
smontagu: review+
Details | Diff | Splinter Review

Description Michel Nédélec 2012-04-23 07:42:09 PDT
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;
Comment 1 Michel Nédélec 2012-05-02 09:20:37 PDT
Created attachment 620349 [details] [diff] [review]
Patch for PluralForm.jsm
Comment 2 Axel Hecht [:Pike] 2012-05-08 10:22:17 PDT
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.
Comment 3 Axel Hecht [:Pike] 2012-05-08 10:24:53 PDT
PS: The existing tests are in http://mxr.mozilla.org/mozilla-central/source/intl/locale/tests/unit/
Comment 4 Michel Nédélec 2012-05-12 02:19:20 PDT
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.
Comment 5 Michel Nédélec 2012-05-12 02:23:11 PDT
Created attachment 623403 [details] [diff] [review]
Patch for PluralForm.jsm and test_pluralForm.js

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 ?
Comment 6 Axel Hecht [:Pike] 2012-05-22 03:35:23 PDT
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.
Comment 7 Michel Nédélec 2012-05-28 10:38:48 PDT
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.
Comment 8 Axel Hecht [:Pike] 2012-05-29 05:10:22 PDT
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.
Comment 9 Axel Hecht [:Pike] 2012-05-29 07:18:58 PDT
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?
Comment 10 Michel Nédélec 2012-05-29 11:41:58 PDT
Thanks you, Axel!
I will take care of that if I have to do patches in the future.
Comment 11 Ryan VanderMeulen [:RyanVM] 2012-06-09 11:24:43 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/aba4c340a437

Thanks for the patch, Michel! Sorry for the delay getting it checked in.
Comment 12 Ryan VanderMeulen [:RyanVM] 2012-06-09 19:43:11 PDT
https://hg.mozilla.org/mozilla-central/rev/aba4c340a437

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