Closed jfstgermain closed 7 years ago
Seems like i18next.getFixedT()
does the same thing
We used to have the getFixedT
in the old days we had no option to create new instances of i18next.
The instance that get created is using the cloneInstance function: https://www.i18next.com/api.html#cloneinstance
So there is no new initialization of backend or loading of translations (if already loaded/preloaded).
Hello, I enabled the i18next debug mode and kept seeing i18next initialization messages at each request. After digging in the middleware code I saw that i18next is being cloned and initialized for each request!
That could become an issue depending on the backend being used not to mention that it renders the translation caching (preloading) useless (it seems that the backend initialization routine is also triggered down the road)... Is there a particular reason why this was done in this fashion instead of passing a language code around and only using one instance of i18next? My usage is pretty basic for now, I only use the
t()
function but what about something like: