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

[Bug] useMoney Hook Error: Incorrect locale provided (hydrogen-react package) #1059

Closed
danf97 opened this issue Jun 29, 2023 · 4 comments · Fixed by #1132
Closed

[Bug] useMoney Hook Error: Incorrect locale provided (hydrogen-react package) #1059

danf97 opened this issue Jun 29, 2023 · 4 comments · Fixed by #1132

Comments

@danf97
Copy link

danf97 commented Jun 29, 2023

What is the location of your example repository?

No response

Which package or tool is having this issue?

hydrogen-react

What version of that package or tool are you using?

2023.4.4

What version of Remix are you using?

No response

Steps to Reproduce

This happens when using the useMoney hook from hydrogen-react when having a language iso code with more then 2 characters. For example: 'PT_PT', 'PT_BR'.

Meaning that there are possible locales like: PT_PT-PT, PT_PT-BR, PT_ES

So there is a combination of the country iso code (that are always 2 digits) - documentation here - and language iso code (that can be 2 digits - XX - or 5 digits - XX_XX) - documentation here

Expected Behavior

It should take into count that are possible iso codes that have more then two characters.

Actual Behavior

It should take into count that are possible languages iso codes that have more then two characters.

Related issue: [BUG] useMeasurement and useMoney Hooks Error: Incorrect locale information provided #1800

@danf97
Copy link
Author

danf97 commented Jun 29, 2023

Hello @lordofthecactus and @frehner,

Sorry to ping you but I think you are familiar with this issue.

Thanks,
Daniel

@wizardlyhel
Copy link
Contributor

Hi @danf97, thank you for spotting this bug. we'll get a release out with a fix that make sure we stripe out SFAPI specific language strings so that it works with Intl.NumberFormat spec.

@QuentinGibson
Copy link
Contributor

we'll get a release out with a fix that make sure we stripe out SFAPI specific language strings

@wizardlyhel does this mean that there will be a change to the language and money codes in the near future?

@wizardlyhel
Copy link
Contributor

Not on the storefront API - just within Hydrogen

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