OpenMAIC-React / src /lib /i18n /config.ts
muthuk1's picture
Convert OpenMAIC from Next.js to React (Vite)
f56a29b verified
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import resourcesToBackend from 'i18next-resources-to-backend';
import { supportedLocales } from './locales';
import { defaultLocale } from './types';
i18n
.use(initReactI18next)
.use(resourcesToBackend((language: string) => import(`./locales/${language}.json`)))
.init({
lng: defaultLocale,
fallbackLng: defaultLocale,
supportedLngs: supportedLocales.map((l) => l.code),
interpolation: {
escapeValue: false,
},
});
export default i18n;