Multiple translation files not working.
5.0.0-beta.4
SecondPage.getInitialProps = async () => ({
namespacesRequired: ['common', 'footer', 'anotherFile'],
})
export default withTranslation(['common', 'anotherFile'])(SecondPage)
The content of both files has to be taken into account
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
withTranslationHOC, only the first namespace can be used without prefix. All the other ones (in your caseanotherFile) have to be prefixed with the filename:
t('anotherFile:translationFromAnotherFile')
You are right. Sorry for the mistake.
Thank you.
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
withTranslationHOC, only the first namespace can be used without prefix. All the other ones (in your caseanotherFile) have to be prefixed with the filename:t('anotherFile:translationFromAnotherFile')