i18n._ does not format values in production build
See original GitHub issueDescribe the bug
When using i18n._
with the second argument “values” those values are not inserted into the string in production build, but they are inserted into the string in development when running npm run start
.
To Reproduce I have created a sample repository that can be used to reproduce the problem:
https://github.com/nmoinvaz/lingui-values-bug
Relevant code file: https://github.com/nmoinvaz/lingui-values-bug/blob/main/src/App.js
npm install
npm run start
In development the strings are properly replaced:
npm build
serve -s build
In production the strings are not properly replaced:
Expected behavior
The values object should be inserted into the string. For example {a}
should be replaced with 1
.
Additional context
- ling-ui version 3.9.0
- Create React App
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (10 by maintainers)
Top Results From Across the Web
angular i18n translation in production not working
angular i18n doesn't work with aot. try to build like this make sure to turn aot off: ... i18nFormat: the format of the...
Read more >Develop with formatjs | Format.JS
Issue when we try to format a sentence but some of the placeholder values are malformed, e.g passing in a string for a...
Read more >React i18n: A step-by-step guide to React-intl - Lokalise Blog
React-intl is a part of FormatJS and is the best React i18n library. Localizing Text, Numbers, and DateTime can be handled easily with...
Read more >How to properly internationalize a React application using ...
Based on how long i18next already is available open source, there is no real i18n case that could not be solved with i18next....
Read more >Optimization - Vue I18n - Intlify
IF CSP is enabled, vue-i18n.esm-bundler.js would not work with ... If you do the production build, Vue I18n will automatically bundle the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Figured it out, works like a charm in development and production builds! Thank you.
Polish some details and I’ll release a new version with this new tool