Closed Bug 1834305 Opened 2 years ago Closed 2 years ago

Drop intl/locale/PluralForm.sys.mjs as unused in m-c

Categories

(Core :: Internationalization, task)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: eemeli, Assigned: eemeli)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Once bug 1760047 and bug 1793557 are resolved, intl/locale/PluralForm.sys.mjs will no longer be used by anything in mozilla-central. It is still used in comm-central, so the current code should probably be copied there & its local usage adapted to match.

A variant of the class still remains as devtools/shared/plural-form.js, and has some usage that ought to also be migrated to Fluent to allow it too to be dropped.

Thank you so much for checking comm-central.
Indeed, we would like to copy it as we're planning to kick off a more targeted fluent migration effort around the end of this year.
Is this something anyone from the m-c side could take care of or would you prefer for one of us to handle the port?

As I'm the one that'll be landing the m-c patches removing PluralForm and I've no practical experience with c-c work, I would very much prefer someone else to take care of that side of things.

Note that you'll probably also want to migrate the pluralRule string from intl.properties to a c-c location at the same time or sometime soon after, as we'll want to remove that from m-c when the devtools copy of PluralForm is eventually also dropped.

On that note: Flod, do we have any tooling or experience migrating .properties strings from m-c to c-c, or will this be a learning experience for us?

Flags: needinfo?(francesco.lodolo)

(In reply to Eemeli Aro [:eemeli] from comment #2)

On that note: Flod, do we have any tooling or experience migrating .properties strings from m-c to c-c, or will this be a learning experience for us?

I've done it before, but at the time both Firefox (browser+toolkit) and Thunderbird (mail) lived in the same l10n repository.

Now Thunderbird localizations lives in a monorepo (comm-l10n), so it would be up to comm folks to find a solution to maintain translations.
For sure, we don't the pluralRule to be changed randomly by locales (it's still "guarded" in mozilla-central via scripts).

Maybe it's time to have this list defined in code, and not as a localizable string?

Flags: needinfo?(francesco.lodolo)
No longer blocks: 1790189
Blocks: 1836793

(In reply to Francesco Lodolo [:flod] from comment #3)

Maybe it's time to have this list defined in code, and not as a localizable string?

This would probably make the migration to c-c easier, as the job then would be to take the current values of pluralRule and use them to redefine the mapping used by PluralForm, rather than needing to figure out a pretty complex migration and set up additional guards for the value's later modification by Thunderbird localisers.

Assignee: nobody → earo
Status: NEW → ASSIGNED

This library is now completely unused in m-c.

We still use this in in Thunderbird for Calendar and Mail: https://searchfox.org/comm-central/search?q=PluralForm.sys.mjs&path=&case=false&regexp=false

Should we plan on dropping it and porting what you did?
Could you give us some time to tackle this before removing that module?

In the short term, you should copy the PluralForm.sys.mjs that's removed here to c-c and change references to it to use its c-c path. That should be enough to make this bug's changes not break your code.

Once bug 1536379 is also fixed, we'll want to fix bug 1836793, which will remove a dependency of PluralForm.sys.mjs. To avoid that breaking, see the comments above here recommending that you port the language-specific pluralRule data into code: That'll be simpler than managing a cross-repo migration of the localised data. You should be able to do that as a next step after the initial copy.

In the longer term, you should indeed migrate the PluralForm messages to a better syntax like Fluent. What we currently have is a really rather custom hack which isn't well supported even in Pontoon. But this will probably take a while.

What sort of time would you need to copy the file and change its references? Its tests are removed here as well, so you may want to take those along as well.

Flags: needinfo?(alessandro)

We're gonna try to tackle it for this week in bug 1847844

Flags: needinfo?(alessandro)
Pushed by earo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8410071a137a Remove intl/locale/PluralForm.sys.mjs as unused. r=nordzilla,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: