-
Notifications
You must be signed in to change notification settings - Fork 386
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
fix: unicode chars were extracting with double slashes #1035
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/lingui-js/js-lingui/De3JPP6YZa39dTnF2WTo3Q6ZUxTJ |
size-limit report 📦
|
Codecov Report
@@ Coverage Diff @@
## main #1035 +/- ##
=======================================
Coverage 83.21% 83.21%
=======================================
Files 53 53
Lines 1626 1626
Branches 441 441
=======================================
Hits 1353 1353
Misses 158 158
Partials 115 115
Continue to review full report at Codecov.
|
I've just tested it and it seems NOK, read more here #1022 (comment) |
Absolutely right. Drunk some coffees and took the playground i've built yesterday of React Native and start trying out things. What i've found:
Cool things I've think I found a fix: What extracts?: /*eslint-disable*/ export const messages = {
'Autoriser l’envoi d’e‑mails': 'Autoriser l’envoi d’e‑mails',
EAN: 'EAN',
'Profite de 300 €': 'Profite de 300 €',
'Version {0}': ['Version ', ['0']],
}; #: App.tsx:41
#: App.tsx:43
msgid "Autoriser l’envoi d’e‑mails"
msgstr "Autoriser l’envoi d’e‑mails"
#: App.tsx:33
#: App.tsx:35
msgid "EAN"
msgstr "EAN"
#: App.tsx:37
#: App.tsx:39
msgid "Profite de 300 €"
msgstr "Profite de 300 €"
#: App.tsx:45
msgid "Version 300 € {0}"
msgstr "Version 300 € {0}" In the case you want strings with unicode chars in the compiled and the .po file, you can use this option in the lingui.config.js: compilerBabelOptions: {
jsescOption: {
minimal: false,
},
},
More info about this option here: https://lingui.js.org/ref/conf.html#compilerbabeloptions I think we're close of fixing this, the pending one is to make sure that this fixes are fixed also in the prod build |
Also i saw that we use EventEmitter class for our internal events inside Lingui but React Native doesn't have EventEmitter, I'm looking already on it |
Re-fixes the unicode error we found migrating the passCulture application to v3.
I went for a walk and start to think about this and saw that we weren't extracting correctly the unicodes.
\\unicode
is not correct =>\unicode
this is correctprobably with this adjustment we fix the wrong behaviour when we built the application to production
About the string failing in development about not being processed as a string, we'll see tomorrow debuggin the node_modules which is the root cause
#1022