-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
i18next-icu incompatible with react-i18next <Trans> #33
Comments
@jamuhl apologies to ask this again, but this is a pretty serious regression I missed in the work for 2.0.0, do you think. you might have time to look over the PR fixing it in the next few days? |
(if not, it's fine, I have a stopgap, just want to know if I need to use our forked package until there is time to review, or if I can wait for 2.0.1) |
Would be great to have this fixed & merged soon. We're experiencing the same issue - I thought at first this was intended behaviour and escaped the tags, but I would be better to avoid this. |
fix #33: i18next-icu incompatible with react-i18next
Thanks for your quick response! This fixes the issues and allows me to avoid explicitly escaping tags. I have already updated the dependency to latest 2.0.2 👍 |
🐛 Bug Report
When using i18next-icu 2.0.0 with a
react-i18next
<Trans>
component, the parsing fails, and no arguments are replaced.This is because
IntlMessageFormat
2.x did not have theignoreTag
option. Version 9.4.6 now has this, which means that whenIntlMessageFormat
sees a placeholder like<0></0>
it expects that to exist in the options, much like thevalue
in the reproduce case below.react-i18next
and other implementations handle the placeholders above the icu parser, and so theignoreTag
option should be enabled.To Reproduce
Expected behavior
The translation should be
"This <b>bold tag</b> triggers an error, and as a result this is not replaced"
but is
"This <b>bold tag</b> triggers an error, and as a a result {value}"
Your Environment
The text was updated successfully, but these errors were encountered: