UNPKG

demo-lenguaje-2

Version:
31 lines (28 loc) 820 B
import i18n from "i18next"; import Backend from "i18next-xhr-backend"; import { initReactI18next } from "react-i18next"; i18n // learn more: https://github.com/i18next/i18next-xhr-backend .use(Backend) .use(initReactI18next) // for all options read: https://www.i18next.com/overview/configuration-options .init({ fallbackLng: "es-ES", debug: false, interpolation: { escapeValue: false }, backend: { loadPath: "/locales/{{lng}}/{{ns}}.json", addPath: "/locales/{{lng}}/{{ns}}.json", crossDomain: true, customHeaders: { headers: { "Access-Control-Allow-Origin": "*", "Content-type": "application/json", "Access-Control-Allow-Methods": "GET" } } } }); export default i18n;