Set default namespace when calling useTranslation
Opened this issue · 0 comments
stichiboi commented
I'm writing my nested JSON strings to organize better and keep keys shorter.
The problem is that every time I use the translations, I have to write the full path of the nested key
const {t} = useTranslation();
const title = t("hero.title");
const description = t("hero.description")
My proposal: add optional parameter to useTranslation
that lets you define a prefix path
to all the keys you use
Example:
const {t} = useTranslation("hero");
const title = t("title");
const description = t("description")