Closed burnhamrobertp closed 2 weeks ago
Did you try: https://github.com/i18next/i18next-multiload-backend-adapter ?
No, I'll check that out. Its documentation seems a bit sparse but I'll give it a try
If you have any idea as to how to structure the use if i18next-http-backend (notably the parse function) in combination with multiload backend, that would be helpful. I do think that multiload is closer to being a proper solution that what we were trying to accomplish before, so I appreciate the suggestion.
Presently, no matter what I return from the parse
function in http-backend
I don't actually get any localizations loaded for namespaces (even though i18next thinks they're loaded)
{
en: {
account: {
my: 'key'
},
analytics: {
my: 'key in another ns'
}
},
de: {
account: {
my: 'key in de'
},
analytics: {
my: 'key in de in another ns'
}
}
}
Thanks, I do see now that this is even addressed in the http-backend readme, just a little too subtle for me to have noticed initially
Documentation issue
It isn't clear (or perhaps isn't possible...although this would be odd?) whether there is a way to configure the http-backend to fetch localizations on a per-language basis, rather than on a per-namespace basis.
Using something like the following will work, but it will send off multiple requests (one for each namespace) as that's typically how i18next is utilized:
Unfortunately, this codebase predates quite a bit of best-practices in this regard, and while migrating the namespaces into their own files could work, its not ideal. It occurs to us that using
request
we might be able to achieve this outcome ourselves, but it seems peculiar that it would be so involved. Any assistance would be appreciated; I'm not certain this is even a documentation/configuration issue with i18next-http-backend; there might be a setting in i18next that we can't find; or might not exist at all