16 lines
494 B
TypeScript
16 lines
494 B
TypeScript
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
import Backend from "i18next-http-backend";
|
|
|
|
i18n
|
|
.use(LanguageDetector) // detects browser language
|
|
.use(initReactI18next)// passes i18n down to react-i18next
|
|
.use(Backend) // loads translations asynchoronusly from /locales/{{lng}}/{{ns}}.json
|
|
.init({
|
|
fallbackLng: "en", // fallback language
|
|
debug: true,
|
|
});
|
|
|
|
export default i18n;
|