Closed EmanuelBenHamo closed 3 years ago
the backup backend needs to be at the second position. Only if the first backend is not able to return the requested namespaces, it will fallback to the second backend
@adrai I didn't understand your answer. what should be changed in this config?
I am trying to get the backup file not from the CDN, but from another folder in my project (it is local static file). I don't want to fetch the backup file from CDN, it has to be stored inside the app.
Is it possible to use backend to load local files, from another directory in the project?
if it's a react app, you have no access to the filesystem during runtime... it would be possible to have 2 different http-backends configured in a chained-backend, but I don't think this is what you are looking for
all I want is to use backupMessages as fallback namespace in case loading the other namespaces from CDN will fail. It it possible? how? still couldn't understand how to get it.
You need to create your own backend and then chain it... https://github.com/i18next/i18next-http-backend/blob/master/example/fallback/app.js
@adrai Thanks for your help! It solved my problem.
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.
There are many ways to help this project 🙏
Hello, I am trying to config my i18n to have local static json file: "backupMessages.json", and also to fetch other messages file from CDN, by using i18next-http-backend.
I came to this configuration but it only loads the local static file "backupMessages.json", without the files from the CDN:
couldn't find a way to make it work.
any help? thanks :)