Next-i18next: Multiple translation files not working in 5.0.0-beta

Created on 20 Jul 2020  路  2Comments  路  Source: isaachinman/next-i18next

Describe the bug

Multiple translation files not working.

Occurs in next-i18next version

5.0.0-beta.4

Steps to reproduce

SecondPage.getInitialProps = async () => ({
namespacesRequired: ['common', 'footer', 'anotherFile'],
})

export default withTranslation(['common', 'anotherFile'])(SecondPage)

Expected behaviour

The content of both files has to be taken into account

Most helpful comment

First of all, the description of your issue is pretty bad, but I think I know what you're trying to achieve.

In the withTranslation HOC, only the first namespace can be used without prefix. All the other ones (in your case anotherFile) have to be prefixed with the filename:

t('anotherFile:translationFromAnotherFile')

All 2 comments

First of all, the description of your issue is pretty bad, but I think I know what you're trying to achieve.

In the withTranslation HOC, only the first namespace can be used without prefix. All the other ones (in your case anotherFile) have to be prefixed with the filename:

t('anotherFile:translationFromAnotherFile')

First of all, the description of your issue is pretty bad, but I think I know what you're trying to achieve.

In the withTranslation HOC, only the first namespace can be used without prefix. All the other ones (in your case anotherFile) have to be prefixed with the filename:

t('anotherFile:translationFromAnotherFile')

You are right. Sorry for the mistake.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddereszewski picture ddereszewski  路  3Comments

slava-lu picture slava-lu  路  6Comments

HectorLS picture HectorLS  路  6Comments

romaincointepas picture romaincointepas  路  6Comments

sb-bilal-dev picture sb-bilal-dev  路  6Comments