-
Notifications
You must be signed in to change notification settings - Fork 364
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
Lingui CLI extraction puts msgid as msgstr #1921
Comments
I don't have a capacity to look into it right now, but can provide you with a direction: Here is a snippet responsible for default message: js-lingui/packages/cli/src/api/catalog/extractFromFiles.ts Lines 32 to 58 in 2cb5175
You can debug it and make a PR. Thanks. |
What is the expected behavior here?. Should it throw error when it encounters two different messages for same ID? |
Yes, but should ignore instances where message is not provided (take existing if any) |
Describe the bug
In my application, I have a translation with ID
addToCart
. Since I use it in multiple files, I've only provided a default message once. Now, when I extract the messages, it's extracted as:To Reproduce
Steps to reproduce the behavior, possibly with minimal code sample, e.g:
ComponentOne.tsx
ComponentTwo.tsx
Now run
lingui extract --overwrite --clean
with this aslingui.config.js
:Expected behavior
I expect the message to be extracted as:
Additional context
Add any other context about the problem here.
lingui --version
: 4.8.0npm list @babel/core
: 7.24.4@lingui/swc-plugin
babel-macro-plugin
.babelrc
) or framework you use (Create React App, NextJs, Vite): I'm using Next.jsThe text was updated successfully, but these errors were encountered: