-
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
fix: allow passing any expression as custom i18n instance #1475
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
@janicduplessis thanks for you contribution. We have an active development in |
6c6e427
to
069c2fa
Compare
@thekip Ok, I rebased against the next branch |
@thekip do we need the same fix for the SWC plugin? |
I'm not sure. We need to write the same test case and check how it behaves. Extra point: we need somehow to write a universal test fixtures for both SWC and Babel transform, to be always sure that they behave the same |
Description
Currently passing a custom i18n instance to the
t
macro only supports passing identifier, although any expression should be valid.For example this currently crashes during extraction:
This changes the check from
isIdentifier
toisExpression
so we can support function calls or member properties.Types of changes
Checklist