Replies: 2 comments
-
This is one of the ways in order to do it... The other is use only one const t = useTranslation()
// Consume translations with the namespace
const commonTranslation = t('common:some-key')
const homeTranslation = t('home:some-key')
const common2Translation = t('common_part_2:some-key') or const t = useTranslation('common') // the default is common
// Consume translations with the namespace
const commonTranslation = t('some-key') // Without namespace is the common
const homeTranslation = t('home:some-key')
const common2Translation = t('common_part_2:some-key') |
Beta Was this translation helpful? Give feedback.
0 replies
-
It would be nicer if |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, if I want to use multiple namespaces in one component, i have to do something like thie
This gets troublesome quickly with larger locales where I have to split them into many files/namespaces.
Even in the most common scenario, with just a common and home namespace, i have to use
useTranslation
twice.Am I missing something or this is how everyone has been doing it?
Beta Was this translation helpful? Give feedback.
All reactions