mirror of
https://github.com/cerc-io/mars-interface.git
synced 2025-01-03 10:06:48 +00:00
35 lines
768 B
TypeScript
35 lines
768 B
TypeScript
import i18next from 'i18next'
|
|
import LanguageDetector from 'i18next-browser-languagedetector'
|
|
import HttpApi from 'i18next-http-backend'
|
|
import { initReactI18next } from 'react-i18next'
|
|
|
|
declare module 'i18next' {
|
|
interface CustomTypeOptions {
|
|
returnNull: false
|
|
}
|
|
}
|
|
|
|
i18next
|
|
.use(HttpApi)
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
backend: {
|
|
crossDomain: true,
|
|
loadPath() {
|
|
return 'https://raw.githubusercontent.com/mars-protocol/translations/master/{{lng}}.json'
|
|
},
|
|
},
|
|
react: {
|
|
useSuspense: true,
|
|
},
|
|
fallbackLng: ['en'],
|
|
preload: ['en'],
|
|
keySeparator: '.',
|
|
interpolation: { escapeValue: false },
|
|
lowerCaseLng: true,
|
|
load: 'languageOnly',
|
|
})
|
|
|
|
export default i18next
|