Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

getTranslation

Use the translation function outside of React components.

It's like useTranslation but it's not a hook, it can be used outside of React.

const { getTranslation } = createI18nApi(...);

const { t } = getTranslation("MyComponent");  

t("greating", { "who": "Jhon" });

Last updated

Was this helpful?