Concurrent request causes wrong language on server
lucasfeliciano opened this issue · 2 comments
lucasfeliciano commented
I'm facing a problem where when my server has concurrent requests when server side rendering sometimes the language is not correct, instead, is the one from the concurrent request.
Diving into the code I saw this part here
https://github.com/i18next/i18next-express-middleware/blob/master/src/index.js#L19
Which make me wondering why clone the i18n instance with { initImmediate: false }
instead of true
.
jamuhl commented
because setting it to false will: https://github.com/i18next/i18next/blob/master/src/i18next.js#L25
makes init call sync on express side - as cloning takes same already loaded translations
lucasfeliciano commented
Thank you for the response. The problem that I had is fixed :)