Skip to content
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

Parser not using default-namespace when multiple-namespaces are provided #5

Open
hschmied opened this issue May 18, 2020 · 2 comments
Labels
enhancement New feature or request waiting

Comments

@hschmied
Copy link
Member

The following scenario the parsing-process correctly creates 3 keys in the localization namespace file ...

  const {t, i18n} = useTranslation('localization', {useSuspense: true});
  ...
  <Text>{t('localization:test_dragonfruit')}</Text>
  <Text>{t('localization:test_elderberries')}</Text>
  <Text>{t('test_fig')}</Text>

In this scenario, though, the last key is not written into the localization namespace, but a separate one (translation.json) ...

  const {t, i18n} = useTranslation(['localization', 'app', 'common'], {useSuspense: true});
  ...
  <Text>{t('localization:test_dragonfruit')}</Text>
  <Text>{t('localization:test_elderberries')}</Text>
  <Text>{t('test_fig')}</Text>

Expected behavior: when multiple namespaces are provided, ideally the parser identifies the first namespace as default and writes the key into the corresponding file.

@hschmied hschmied added the enhancement New feature or request label May 18, 2020
@kirrg001
Copy link
Contributor

kirrg001 commented May 18, 2020

I'd suggest to look if a bug issue at i18n-parser exist and if not, create one. Till this get's fixed, we could add a requirement that this notation is not allowed?

@hschmied
Copy link
Member Author

Update -- there's some code regarding this use-case, but I think it's check isn't working in the namespace-array use case. I've written the original poster of the fix to get his/her feedback.

i18next/i18next-parser#195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting
Projects
None yet
Development

No branches or pull requests

2 participants