UNPKG

infra-cli

Version:
33 lines (29 loc) 595 B
import i18n from 'i18next' import detector from 'i18next-browser-languagedetector' import { initReactI18next } from 'react-i18next' const resources = { en: { translation: {} }, zh: { translation: {} } } export const i18next = i18n .use(detector) .use(initReactI18next) .init({ resources, // lng: defaultLng, fallbackLng: 'en', keySeparator: false, interpolation: { escapeValue: false }, detection: { order: ['localStorage'], lookupLocalStorage: 'i18n_language', caches: ['localStorage'] } }) export default i18n