mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
- Remove legacy .eslintrc.cjs and .eslintignore - Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url) - Add .prettierrc and .prettierignore - Format entire codebase with prettier
41 lines
846 B
TypeScript
41 lines
846 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
import ru from './locales/ru.json';
|
|
import en from './locales/en.json';
|
|
import zh from './locales/zh.json';
|
|
import fa from './locales/fa.json';
|
|
|
|
const resources = {
|
|
ru: { translation: ru },
|
|
en: { translation: en },
|
|
zh: { translation: zh },
|
|
fa: { translation: fa },
|
|
};
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources,
|
|
fallbackLng: 'ru',
|
|
supportedLngs: ['ru', 'en', 'zh', 'fa'],
|
|
|
|
detection: {
|
|
order: ['localStorage', 'navigator'],
|
|
caches: ['localStorage'],
|
|
lookupLocalStorage: 'cabinet_language',
|
|
},
|
|
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
|
|
react: {
|
|
useSuspense: false,
|
|
},
|
|
});
|
|
|
|
export default i18n;
|