项目文件夹

文件
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

20 行
550 B
TypeScript

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;