Next.js Discord

Discord Forum

next-intl problem

Unanswered
European hornet posted this in #help-forum
Open in Discord
European hornetOP
Hey!
how can I use (t) function in Next.js application outside server or client component (like utility function)

in server component
i can get the translations like this

const t = await getTranslations()

in client component like this:

const t = useTranslations()

but in utility function
like this

const getLoginSchema = () => { const t = getTranslations() return ..... }

this is not work!
any help!
thanks

0 Replies