altricade_portofolio/src/lib/i18n.ts
Заид Омар Медхат | Zaid Omar Medhat fab8983d5c
Some checks failed
Deploy / deploy (push) Failing after 5m27s
init
2026-07-09 12:21:21 +05:00

31 lines
711 B
TypeScript

import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import { config } from '@lib/config'
import en from '@/locales/en.json'
import ru from '@/locales/ru.json'
const resources = {
en: { translation: en },
ru: { translation: ru },
}
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources,
fallbackLng: config.defaultLanguage,
supportedLngs: config.supportedLanguages,
interpolation: {
escapeValue: false,
},
detection: {
order: ['localStorage', 'navigator'],
caches: ['localStorage'],
lookupLocalStorage: 'language',
},
})
export default i18n