-
-
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
ICU Interpolation does not work with React Native production bundle #66
Comments
Make sure |
Yes, we are using version 10.5.0 of |
is there any warning if you set debug to true? |
There is no warning when debug is set to true in the console. It may be an issue with the JavaScript engine we are trying to use. I will sync with react-native folks to see if they are familiar with any similar issues. EDIT: I should also note that the issue repros even without using Hermes Bytecode optimization. It may be reproducible with similar production-ready JavaScript bundles for the web, not just with react-native. Would be worth trying if you have the time. If not, I can give it a try tomorrow. EDIT2: Finally got around to testing. This seems to be an issue specific to the hermes JS engine. Repro steps:
|
🐛 Bug Report
We are running a React Native app for Windows using Hermes bytecode optimization to generate our JavaScript bundle. When trying to use the ICU format for i18next, everything seems to work fine when loading our JavaScript bundle ad-hoc via metro in our usual development flow. However, when we use a production bundle interpolation ceases to work.
To Reproduce
We do have a
Suspense
element wrapped around the component we are trying to render with theuseTranslation
hook. Everything works fine if we stop using the ICU format in the i18n object and change the interpolation prefix/suffix to single curly-braces.Expected behavior
If we use a translation like this:
helloUser: "Hello {1}"
The following should work with production bundles as well as developer/debug mode via metro:
Your Environment
The text was updated successfully, but these errors were encountered: