gilbsgilbs / babel-plugin-i18next-extract

Babel plugin that statically extracts i18next and react-i18next translation keys.
https://i18next-extract.netlify.com
MIT License
159 stars 37 forks source link

Ability to extract translations from objects #198

Open eric-burel opened 3 years ago

eric-burel commented 3 years ago

This PR brings an improvement to the "variable keys" scenarion (https://i18next-extract.netlify.app/#/faq?id=how-to-deal-with-variable-keys).

It lets you define object keys that will systematically be considered as i18n token. It works exactly like a t function call, with custom names for the function, but using an object field instead.

Limitations:

gilbsgilbs commented 3 years ago

Hey thanks for the PR. I'll look into it in ~2 weeks as I'm currently on vacation. Please remind me if I forget 😊.

eric-burel commented 3 years ago

Enjoy the vacations! And thanks for this package in the first place, the contributor experience is outstanding given how complex a Babel plugin can be, the testing in particular is great.

gilbsgilbs commented 3 years ago

That one comment really made my day 🥲. Thanks.