gilbsgilbs / babel-plugin-i18next-extract

Babel plugin that statically extracts i18next and react-i18next translation keys.

Home Page:https://i18next-extract.netlify.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't extract namespaces if used props destruction

pgrekovich opened this issue · comments

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

  • OS: MacOS 10.15.4
  • Plugin version: 0.6.1
  • Node version: 10.16.0