First setup help
Let's try to figure out what you need.
import i18next from 'i18next';
import Backend from 'i18next-fs-backend';
const backend = new Backend({
// path where resources get loaded from
loadPath: '/locales/{{lng}}/{{ns}}.json'
});
i18next
.use(backend)
.init({
// initImmediate: false, // setting initImediate to false, will load the resources synchronously
...opts,
...yourOptions
}); // yourOptions should not include backendOptions!
import i18next from 'i18next';
import en from './locales/en.json'
import de from './locales/de.json'
i18next
.init({
...opts,
...yourOptions,
resources: {
en,
de
}
});
Last modified 2yr ago