gilbsgilbs / babel-plugin-i18next-extract

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

Support fallback keys #238

Open ParallelUniv3rse opened 2 years ago

ParallelUniv3rse commented 2 years ago

Is your feature request related to a problem? Please describe.

Can this plugin support fallback keys as per https://www.i18next.com/principles/fallback#calling-with-fallback-keys

Describe the solution you'd like

Plugin extracts all keys in the array of fallback keys.

Describe alternatives you've considered

Don't really see an alternative approach.

Additional context

Example that does not work right now:

{t(['{{count}} den', 'dní'], { count: diff.days })}

the fallback key does not get extracted.