-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi18n.ts
52 lines (48 loc) · 1.51 KB
/
i18n.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import Backend from 'i18next-http-backend'
import { initReactI18next } from 'react-i18next'
import address from '../public/locales/en/address.json'
import common from '../public/locales/en/common.json'
import dnssec from '../public/locales/en/dnssec.json'
import names from '../public/locales/en/names.json'
import profile from '../public/locales/en/profile.json'
import register from '../public/locales/en/register.json'
import settings from '../public/locales/en/settings.json'
import transactionFlow from '../public/locales/en/transactionFlow.json'
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
supportedLngs: ['en', 'zh', 'de', 'nl'],
keySeparator: '.',
interpolation: {
escapeValue: false,
},
defaultNS: 'common',
ns: [
'address',
'common',
'dnssec',
'names',
'profile',
'register',
'settings',
'transactionFlow',
],
react: {
useSuspense: false,
},
})
// preload english
i18n.addResourceBundle('en', 'address', address)
i18n.addResourceBundle('en', 'common', common)
i18n.addResourceBundle('en', 'dnssec', dnssec)
i18n.addResourceBundle('en', 'names', names)
i18n.addResourceBundle('en', 'profile', profile)
i18n.addResourceBundle('en', 'register', register)
i18n.addResourceBundle('en', 'settings', settings)
i18n.addResourceBundle('en', 'transactionFlow', transactionFlow)
export default i18n