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

Doesn't extract namespaces if used props destruction #142

Closed pgrekovich closed 4 years ago

pgrekovich commented 4 years ago

Describe the bug

If uses withTranslation HOC with namespaces, and props destruction like const MyComponent = ({ t }) => {}, extract translations in the default namespace file

Reproduction:

import { withTranslation } from 'react-i18next';

const MyComponent0 = ({ t }) => {
  return <p>{t('key0')}</p>
}

withTranslation('ns0')(MyComponent0);

Expected behavior

Should extract translates in the namespace files

What actually happens

Your environment