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

Currency Message Format not working. #28

Closed
ojassvi opened this issue Dec 9, 2020 · 4 comments
Closed

Currency Message Format not working. #28

ojassvi opened this issue Dec 9, 2020 · 4 comments

Comments

@ojassvi
Copy link

ojassvi commented Dec 9, 2020

🐛 Bug Report

I am using react-i18next with i18next-icu to support Intl Message formatting. It works as defined here https://formatjs.io/docs/intl-messageformat for Date, Time, Number and Plurals but does not work for currency. I tested this with Intl-messageformat alone and the currency formatting works fine, but doesn't work with i18next-icu.

i18next-icu uses intl-message version 2.2.0 but the latest version available is 9.3.20. The issue is still there with the latest version as well.

To Reproduce

Here is the codesandbox link to reproduce the issue. The error case is shown is red and the expected behaviour in green.

Expected behavior

I expect the string {price, number, ::currency/CAD}" to be formatted through Intl Message format as currency but it is formatting this as a number.

Your Environment

  • runtime version: i.e. node v12.19.0
  • i18next version: i.e. 19.8.4
  • os: Mac
@jamuhl
Copy link
Member

jamuhl commented Dec 10, 2020

Not sure why it does not work: https://github.com/i18next/i18next-icu/blob/master/src/index.js#L81

Might be the https://github.com/i18next/i18next-icu/tree/master/locale-data should be updated to add the currency formatting?!?

PR welcome

@ojassvi
Copy link
Author

ojassvi commented Dec 10, 2020

Thanks for the update. I will dig into it and will send a PR in a few days.

@jamuhl jamuhl closed this as completed Feb 10, 2021
@jamuhl
Copy link
Member

jamuhl commented Feb 10, 2021

this module was updated v2.0.0

@ojassvi
Copy link
Author

ojassvi commented Feb 17, 2021

Thanks, it did fix the issue.

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