-
Notifications
You must be signed in to change notification settings - Fork 393
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 extract doesn't handle i18n._ strings #1178
Comments
Hola Juan, To get extracted you have to use the t`` macro. In that way the Since v3, you don't need to use i18n you can just use directly the macro. For example: import { t } from "@lingui/macro"
export default function App() {
return t`This should be translated!`
} |
Hi, The macros are wonderful, but in the context where I'm using this it is not possible till we finish the migration and we can drop the restriction. |
@juanluispaz , you can use this workaround:
The extractor uses |
I can confirm that this workaround works, thanks @tannerlyons |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
Lingui extract ignores i18n._
To Reproduce
Expected behavior
The text should appear in the .po file
Additional context
I review the source code and I found the function isI18nMethod defined at babel-plugin-extract-messages but it looks like is never used.
3.12.1
7.16.0
.babelrc
):.babelrc { "presets": [ "@babel/preset-env", "@babel/preset-react", "@lingui/babel-preset-react", "@babel/preset-typescript" ] }
.linguirc
).linguirc { "locales": ["en", "es", "de"], "sourceLocale": "en", "catalogs": [{ "path": "<rootDir>/src/app-react/locales/{locale}/translations", "include": ["<rootDir>/src/app-react"], "exclude": ["**/node_modules/**"] }], "format": "po-gettext", "compileNamespace": "ts" }
The text was updated successfully, but these errors were encountered: