Reputation: 77
I'm writing the frontend code using react. I need to change the language on the site using Django. I don't know where to start. Should i use i18next? How can I configure if I need to use it
import i18n from "i18next";
import detector from "i18next-browser-languagedetector";
import backend from "i18next-http-backend";
import { initReactI18next } from "react-i18next";
i18n
.use(detector)
.use(backend)
.use(initReactI18next) // passes i18n down to react-i18next
.init({
fallbackLng: "en", // use en if detected lng is not available
saveMissing: true // send not translated keys to endpoint
});
export default i18n;
Upvotes: 0
Views: 40