Skip to content
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

Remove our fallback implementation of Intl.PluralRules #3465

Open
2 tasks
Tracked by #2621
romaricpascal opened this issue Mar 31, 2023 · 2 comments
Open
2 tasks
Tracked by #2621

Remove our fallback implementation of Intl.PluralRules #3465

romaricpascal opened this issue Mar 31, 2023 · 2 comments

Comments

@romaricpascal
Copy link
Member

romaricpascal commented Mar 31, 2023

What

Remove our fallback implementation for Intl.PluralRules used by the Character Count. For browsers that do not support Intl.PluralRules, fall back to always using the 'other' translation.

Why

As of GOV.UK Frontend v5.0, JavaScript will only run in browsers that support ES6 modules. The intersection of browsers that support ES6 modules but not Intl.PluralRules is relatively small (Safari 10.3 - 12.5 on iOS, Safari 10.1 - 12.1 on macOS, Edge 16-18, Chrome 61-62 and Opera 48-49) and does not justify the overhead of including the polyfill.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • We've validated falling back to the 'other' translation is OK
  • The fallback implementation is removed
@romaricpascal romaricpascal changed the title Remove the alternative implementation of Intl.PluralRules Remove our fallback implementation of Intl.PluralRules Mar 31, 2023
@36degrees 36degrees added this to the v5.x-candidate milestone Apr 13, 2023
@domoscargin
Copy link
Contributor

As part of this, we should have a glance at our use of Intl.NumberFormat - we use similar guards for the two.

@colinrotherham
Copy link
Contributor

@domoscargin I hadn't realised there was overlap in this GitHub issue

As part of this, we should have a glance at our use of Intl.NumberFormat - we use similar guards for the two.

We handled the Intl.NumberFormat check in this change:

But loosened Intl.PluralRules (without removing it) in this one:

Hopefully helpful for when this issue is picked up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants