Open mwskwong opened 4 years ago
Won't work. On a per key level but per namespace: https://github.com/i18next/i18next-multiload-backend-adapter
t
There are two ways to achieve what you like:
a) before going to missed path doing a request to via xhr to find keyB -> bad idea, async, slow -> accessing t
is sync
b) access xhr backend after taking from cache and merge that into the content of the localStorage cached loaded translations -> removes the value of the cache (only acts now as a first fast preload)
What is your use case? Is changing the version in localStorage cache or setting cache duration not sufficient?
+1 on this feature
So let say
i18next-localstorage-backend
cached the following resource:Current Behavior
If the code request for
t("keyB")
, it will return the default value and will not fallback to other backends.Feature Request
If the code request for
t("keyB")
, is it possible to fallback to the next backend (e.g.i18next-xhr-backend
)?