-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PluralRules locale data shimming #200
Conversation
}; | ||
|
||
function getCanonicalLocales(locales) { | ||
const mappedLocales = [locales].flat().map(locale => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only needed for Safari on older OS versions (< macOS ~12, based on sauce testing), which don't map the aliases back to mi
.
@@ -44,7 +44,6 @@ | |||
"sinon": "^19.0.2" | |||
}, | |||
"dependencies": { | |||
"@formatjs/intl-pluralrules": "^1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify: the other things that this polyfill was providing (the plural rules locale data for browsers who don't support the native API) aren't needed at all anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack! Safari 12 is the only browser that isn't blocked that doesn't support Intl.Pluralules
. Do we want to keep it for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In keeping it, we'd simply continue to include it but then override some of its behavior to support Māori?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline.
Brightspace loads... something in Safari 12 but it's completely unuseable so we're going ahead with removing the polyfill. We expect to block Safari 12 in the near future.
🎉 This PR is included in version 3.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Support for Māori across browsers is inconsistent at best. Specifically for
Intl.PluralRules
(which is relied upon byformatjs
to renderplural
arguments), no browsers have (proper) native support for Māori's plural categories. The@formatjs/intl-pluralrules
polyfill also does not have data for Māori, and provides no value otherwise asIntl.PluralRules
is well supported at this point.We can rely on native
Intl.PluralRules
as long as we can shim locale data into it forformatjs
to use. So, that's what we do here.