How to load translations from a custom Node.js server api? #2291
Unanswered
seyaobey-dev
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
-
I would like to use
i18next-http-backend
to load my translations from a custom Node.js server which returns a key-value pairjson
. Thisjson
does not come from a static file (on the server) but from a database. This is thejson
:I'm using the property
request
of the backend options to call my custom backend server:Then in my react application, in the component
HelloWord
, I attempt to apply the translation, but it is not working: it just showing the keyhello_world
instead of the text value. Here is my component:My question is: given my scenario, how should I
merge
the json object returned from the server into my translation resources (or namespace?...) so that the keys are available when and where they're used?Beta Was this translation helpful? Give feedback.
All reactions