Closed Bug 416446 Opened 13 years ago Closed 13 years ago
Form more useful for extensions and delay importing strings for perf
Extensions will have troubles using PluralForm because it uses the browser's plural rule, but if the extension isn't localized to the same rule, there'll be issues. So instead, we can provide a "makeGet" method that basically creates a "PluralForm" for an input plural rule. Now extensions can specify their own plural rule number. Also, we can avoid loading the pluralRule string until we really need to on first access to help perf.
Plus testcase! :)
Comment on attachment 302205 [details] [diff] [review] v1 Not going to get to review this, canceling the request.
Comment on attachment 302205 [details] [diff] [review] v1 r?sdwilsh as this code was going to be in toolkit/ download stuff originally. So perhaps smontagu can give an official r+ if sdwilsh r+s.
Attachment #302205 - Flags: review?(sdwilsh)
Comment on attachment 302205 [details] [diff] [review] v1 r=sdwilsh, but how about makeGetter instead?
Attachment #302205 - Flags: review?(sdwilsh) → review+
(In reply to comment #4) > (From update of attachment 302205 [details] [diff] [review]) > r=sdwilsh, but how about makeGetter instead? Sure. r?smontagu for official review to land Also reordered the return value to be get then numForms to be more consistent with what the consumer probably wants, so the second thing can be easily dropped off.
Attachment #305292 - Flags: review?(smontagu) → review+
Added section http://developer.mozilla.org/en/docs/Localization_and_Plurals#Developing_with_PluralForm
Comment on attachment 305292 [details] [diff] [review] v1.1 a1.9+=damons
Attachment #305292 - Flags: approval1.9? → approval1.9+
Checking in intl/locale/src/PluralForm.jsm; /cvsroot/mozilla/intl/locale/src/PluralForm.jsm,v <-- PluralForm.jsm new revision: 1.5; previous revision: 1.4 done RCS file: /cvsroot/mozilla/intl/locale/tests/unit/test_pluralForm_makeGetter.js,v done Checking in intl/locale/tests/unit/test_pluralForm_makeGetter.js; /cvsroot/mozilla/intl/locale/tests/unit/test_pluralForm_makeGetter.js,v <-- test_pluralForm_makeGetter.js initial revision: 1.1 done
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
You need to log in before you can comment on or make changes to this bug.