Closed Bug 1441146 Opened 6 years ago Closed 6 years ago

Sync DevTools plural-form.js with intl/PluralForm.jsm

Categories

(DevTools :: Framework, enhancement)

enhancement
Not set
normal

Tracking

(firefox60 fixed)

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: flod, Assigned: flod)

Details

Attachments

(1 file)

PluralForm.jsm in /intl receives updates, but they're not ported to the fork in DevTools.
Comment on attachment 8953982 [details]
Bug 1441146 - Sync DevTools plural-form.js with intl/PluralForm.jsm

https://reviewboard.mozilla.org/r/223134/#review229070

Looks good, thanks for syncing!

We might consider extracting the actual logic from PluralForm.jsm to a pure js file that doesn't use Chrome apis so that we can use it from both PluralForm.jsm and devtools' plural-form.js without having to copy code over?
Attachment #8953982 - Flags: review?(jdescottes) → review+
Pushed by francesco.lodolo@mozillaitalia.org:
https://hg.mozilla.org/integration/autoland/rev/aa4476bff0ea
Sync DevTools plural-form.js with intl/PluralForm.jsm r=jdescottes
(In reply to Julian Descottes [:jdescottes][:julian] from comment #2)
> We might consider extracting the actual logic from PluralForm.jsm to a pure
> js file that doesn't use Chrome apis so that we can use it from both
> PluralForm.jsm and devtools' plural-form.js without having to copy code over?

That might be a good question for :pike and :gandalf.

The truth is that we hope to move Firefox to Fluent by the end of the year (or most of it), and we rely on CLDR plural forms for plurals (no more weird hacks on .properties files).
> We might consider extracting the actual logic from PluralForm.jsm to a pure js file that doesn't use Chrome apis so that we can use it from both PluralForm.jsm and devtools' plural-form.js without having to copy code over?

I'd say it would be unfortunate if we had to do this. We have a new shiny `Intl.PluralRules` API which is standardized and exposed to content. I'd prefer us to use that over spreading PluralForms.jsm further.
I was not aware of this API. Do I understand correctly that we should migrate devtools' plural-form to use this?
Flags: needinfo?(gandalf)
> Do I understand correctly that we should migrate devtools' plural-form to use this?

Unfortunately the PluralRules API uses a different model of selecting plural categories than PluralForms.jsm. I had bug 1324880 to try to make us switch to it but it is not trivial to marry `.properties` with PluralRules.

That's solved in Fluent, so the direction would be for devtools to move to Fluent (slash fluent-react).
Flags: needinfo?(gandalf)
https://hg.mozilla.org/mozilla-central/rev/aa4476bff0ea
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: