-
Notifications
You must be signed in to change notification settings - Fork 379
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 doesn't extract msg within a msg #1841
Labels
Comments
joeldouglass
changed the title
Lingui doesn't extract msg with a msg
Lingui doesn't extract msg within a msg
Jan 22, 2024
As far as i remember i fixed something like that for babel version of macros, but this still an issue in SWC. These two issues about JSX ternary but it seems it's also applicable for JS ternary. The workaround would be just avoiding putting ternary into the msg: const innerMessage = ${someFlag ? _(msg`bar`) : _(msg`baz`)}
<SomeComponent title={_(msg`Foo ${innerMessage}`)} /> |
Should be fixed for babel macro with #1867 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a case where we might have a
msg
within amsg
, Lingui skips the innermsg
leading to aReferenceError: msg is not defined
at runtime.Ex:
Maybe there's a better way to do this?
The text was updated successfully, but these errors were encountered: