Determine locale on server #3044
Unanswered
raphi-0901
asked this question in
Q&A
Replies: 2 comments
-
Well what just came to my mind is that I could define a key in my translation files which point to the corresponding locale. en.json: {
"locale": "en"
} de.json: {
"locale": "de"
} and then simply get it like this: const t = await useTranslation(event)
const locale = t('locale') |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you should be able to access the detected locale with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a server route and want to return an object where I need the locale which was also determined by the localeDetector:
Just like this:
How can I get the locale?
Beta Was this translation helpful? Give feedback.
All reactions