What to do if you have multiple 'useTranslations' in the same file? #1196
Unanswered
OguzcanKarakoc
asked this question in
Q&A
Replies: 0 comments
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.
-
Consider the following:
I have the following custom framework file:
You can see that the usageMatchRegex targets both "t" and "tCommon"
The problem I now have is the following:
because
const tCommon = useTranslations('common')comes afterconst t = useTranslations("dashboard"), both "t" and "tCommon" look at the "common" namespace. So for example my en.json would look like:{ "common": { "close": "Close", "save": "Save", "title": "......" }, "dashboard": { } }instead of:
{ "common": { "close": "Close", "save": "Save", }, "dashboard": { "title": "......" } }How would I fix this?
Beta Was this translation helpful? Give feedback.
All reactions