-
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
Allow fallback to a messages defined in the code without compilation #2043
Comments
Would really appreciate const SOME_TEXT = msg`Some text`;
const object = {
originalValue: SOME_TEXT.message,
translatedValue: _(SOME_TEXT)
} |
You don't need to patch, this is a configurable parameter. You can either use pre-release v5 version where macro is extracted to separate babel plugin and parameters could be passed directly to it, or use // babel-plugin-macros.config.js
module.exports = {
// ...
// Other macros config
lingui: {
extract: true,
},
} |
hey @timofei-iatsenko, thanks for this info. Just curious, is using the babel-plugin-macros configuration for lingui and specifically that the extract property is an available property, documented anywhere in the documentation? I feel like I thoroughly reviewed it, and I didn't see this before. |
It's not documented, it is used internally for extractor. Later I will create a documented parameter intended for public use as described here in the first message. But you can safely use this "extract" param, because it's not going to be changed any time soon. |
Hmm I couldn't get it to work but maybe thats because I'm also in a monorepo and it's react native. I'll leave my patch in for now until you get the v5 fully released and tested 🙏 |
ToDo: motivation, related issues
Tasks:
Make configurable
strip_non_essential_fields
in the SWC plugin from outside. Now it's hardcoded to the ENV variablesupress_stripping_message
, which will allow strippingcontext
andcomment
but left message.Make the same options for Babel macro plugin
Make possible to register MessageCompiler in production, PR: feat: add setMessagesCompiler method #2035
Write the docs describing all configuration to achieve that.
The text was updated successfully, but these errors were encountered: