What's the best way to translate text define in a config? #937
Unanswered
akmalmzamri
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
-
Let's say I have a config, and I want to translate the
title
fieldsAnd this config will be used by a client component
Some options that I can think of
A. Store path to message instead of the string itself. Then translate it in a parent server component (i.e.
Dashboard
and pass thelinks
as a prop)B. Store path to message instead of the string itself. Then translate it in the client component itself. But need to wrap the layout with
NextIntlClientProvider
.I'm looking for another alternative where I can translate it directly inside the config, and I found
createTranslator
. However, I'm not sure how to get the current localeBeta Was this translation helpful? Give feedback.
All reactions