react-i18next CSR setup with over the wire translations #2220
Unanswered
ui-mattlucas
asked this question in
Q&A
Replies: 1 comment
-
Try this kind of approach: https://github.com/i18next/i18next-http-backend/tree/master/example/next#alternative-usage-the-preferred-way |
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
-
Each of my pages is tagged with a distribution id that has a variety of languages. Currently, I am feeding that id to a function within (the mostly vanilla) i18n.js to await the resource and load the app.
This kind of works, but it seems like the ready method from useTranslation is always ready, even when there is no resource yet (language tag flickers from tag to language).
It also seems a bit suboptimal.
Is there an example of an app using a similar setup to this to get translations per page over the wire? I don't really have access to namespaces beforehand.
Or should I look into architecting some kind of lazy load with the http library to fetch these resources dynamically for each page?
Here's my i18n
I am a bit confused with the way this is initialized. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions