Replies: 1 comment 1 reply
-
Is an async function and needs the locale, you should use it like this: export async function someHelper({ locale }) {
const t = await getT(locale, 'common')
const title = t('title')
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
First, I'd like to thank you for this library that I'm using for about a year now. My issue is the following one:
I have a TS file containing an array of paragraph objects, with two key : image (as an image source) and content (as string).
I would like my paragraph objects, within the TS file, to get the translation.
I know that getT is supposed to work outside React components. Still, I can not figure out how to get the locale that getT needs to work. If anyone has an idea, it would be wonderful.
Thanks for reading me,
Beta Was this translation helpful? Give feedback.
All reactions