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

Switching the language doesn't affect Intl.Numberformat #24

Open
schuetzm opened this issue Oct 2, 2024 · 1 comment
Open

Switching the language doesn't affect Intl.Numberformat #24

schuetzm opened this issue Oct 2, 2024 · 1 comment

Comments

@schuetzm
Copy link

schuetzm commented Oct 2, 2024

Switch to German, open browser console, try this:

formatter = new Intl.NumberFormat(undefined, {
    style: 'currency',
    currency: 'EUR',
});
formatter.format(10)

Result: "10,00 €"

Then switch to a different language, reload the page, run the same code. The result is still "10,00 €"; it should have been "€10.00".

@M-Reimer
Copy link
Owner

Actually that's just one of a few "Intl" methods:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl
I'm not sure if I want to open that can of worms.
To make this possible, every one of those would have to be hooked, redirected into the Add-on and then modified to work differently if the language is not defined.

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

No branches or pull requests

2 participants