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

Intl.PluralRules.~locale.fr not working correctly #973

Closed
aronwoost opened this issue Jan 12, 2021 · 6 comments
Closed

Intl.PluralRules.~locale.fr not working correctly #973

aronwoost opened this issue Jan 12, 2021 · 6 comments
Labels
library Relates to an Origami library

Comments

@aronwoost
Copy link

aronwoost commented Jan 12, 2021

Bug

What

Intl.PluralRules.~locale.fr polyfill is not working correctly (tested on IE11 and Safari 12).

Details

How to reproduce:

<!DOCTYPE html>
<html>
<head>
  <title></title>
  <script src="https://polyfill.io/v3/polyfill.js?version=3.101.0&flags=gated&features=Intl.PluralRules.~locale.fr"></script>
  <script type="text/javascript">
    console.log(new Intl.PluralRules('fr').select(0));
    console.log(new Intl.PluralRules('fr').select(1));
    console.log(new Intl.PluralRules('fr').select(2));
  </script>
</head>
<body>
  test
</body>
</html>

console.log(new Intl.PluralRules('fr').select(2)); is throwing with:

image

It should log "others".

From reading the code I think that e is indeed never defined. 🤔

However, what does work is this:

<!DOCTYPE html>
<html>
<head>
  <title></title>
  <script src="https://polyfill.io/v3/polyfill.js?version=3.101.0&flags=gated&features=Intl.PluralRules"></script>
  <script src="https://unpkg.com/@formatjs/intl-pluralrules@4.0.5/locale-data/fr.js"></script>
  <script type="text/javascript">
    console.log(new Intl.PluralRules('fr').select(0));
    console.log(new Intl.PluralRules('fr').select(1));
    console.log(new Intl.PluralRules('fr').select(2));
  </script>
</head>
<body>
  test
</body>
</html>

It does correctly output:

image

So I suspect something went wrong there with coping the polyfill.

@origamiserviceuser origamiserviceuser added this to incoming in Origami ✨ Jan 12, 2021
@github-actions github-actions bot added the library Relates to an Origami library label Jan 12, 2021
@JakeChampion
Copy link
Owner

Thanks for reporting this @aronwoost.

@longlho, this looks like an issue within the bundled version of the PluralRules polyfill, would you be able to look into this?

@longlho
Copy link
Contributor

longlho commented Jan 13, 2021

dupe of formatjs/formatjs#2482

we fixed it in 4.0.5 so just need an upgrade

@longlho
Copy link
Contributor

longlho commented Jan 13, 2021

@JakeChampion looks like this already has the fix. Maybe u need to cut a release?

@longlho
Copy link
Contributor

longlho commented Jan 13, 2021

yeah see description in #967

@JakeChampion
Copy link
Owner

Thanks for noticing the missed release. I've now released this update in v3.102.0

Origami ✨ automation moved this from incoming to complete Jan 13, 2021
@aronwoost
Copy link
Author

You're welcome and thanks for releasing! 💪🏼

Pls let me know when polyfill-service is updated.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
@robertboulton robertboulton removed this from Done in Origami ✨ Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
library Relates to an Origami library
Projects
None yet
Development

No branches or pull requests

3 participants