Files
react-starter-kit/src/app/tests/mocks/i18n/i18n.ts
Mastermindzh 0003df5fab - Added translations
- Added pluralization example
  - Added formatter example (with Luxon)
  - Used HTTP loader
- Added a suspense fallback page for app loading
- Added cypress eslint rules
2022-07-08 15:05:05 +02:00

34 lines
729 B
TypeScript

import i18n from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import { initReactI18next } from "react-i18next";
import { i18nSettings } from "../../../../infrastructure/i18n/init";
import en from "app/../../public/i18n/en.json";
import nl from "app/../../public/i18n/nl.json";
i18n
// detect user language
.use(LanguageDetector)
.use(initReactI18next)
.init({
...i18nSettings,
...{
backend: undefined,
fallbackLng: "noLang",
debug: false,
resources: {
en: {
translation: en,
},
nl: {
translation: nl,
},
noLang: {
translation: {},
},
},
},
});
export default i18n;