-
Notifications
You must be signed in to change notification settings - Fork 382
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
Macro: t inside t causing ReferenceError: t is not defined #1848
Comments
is it a real example? Still don't understand the need for using This i suppose known issue, the macro treat May I ask what you expect to get in extracted messages in this case? |
Hey, yeah, it is a real example... just migrating our legacy translation system to Lingui const FORM_MAX_CHARACTERS = "[FIELD] must be [NUM] characters";
t("FORM_MAX_CHARACTERS", { FIELD: t("FIRST_NAME"), NUM: 16 } in the whole application, we are using Macro I know I can use
basically but if it is a limitation of |
Yeah, you probably can solve this differently in your code. This is not a limitation of babel-macro itself, rather how lingui macro is written, and i don't really want to touch it since it may break something else. |
Describe the bug
t
insidet
causing ReferenceError: t is not definedbtw
Trans
inTrans
is workingTo Reproduce
try code
why t in t? for YUP validation schema error messages...
e.g.
Expected behavior
t in t should work
Additional context
Add any other context about the problem here.
I can reproduce it also with fresh CRA
lingui --version
4.6.0npm list @babel/core
@babel/core@7.22.8@lingui/swc-plugin
babel-macro-plugin
.babelrc
) or framework you use (Create React App, NextJs, Vite)The text was updated successfully, but these errors were encountered: