OSDN Git Service

Add the react-i18n package
[bytom/bytom-electron.git] / src / i18n.js
1 import i18n from 'i18next'
2 import LanguageDetector from 'i18next-browser-languagedetector'
3
4 import transaction_zh from './locales/zh/translation.json'
5 import transaction_en from './locales/en/transaltion.json'
6
7 i18n.use(LanguageDetector).init({
8   // we init with resources
9   resources:{
10     en: {
11       translations: transaction_en
12     },
13     zh: {
14       translations: transaction_zh
15     },
16   },
17   fallbackLng: 'en',
18   debug: false,
19
20   // have a common namespace used around the full app
21   ns: ['translations'],
22   defaultNS: 'translations',
23
24   keySeparator: false, // we use content as keys
25
26   interpolation: {
27     escapeValue: false, // not needed for react!!
28     formatSeparator: ','
29   },
30
31   react: {
32     wait: true
33   }
34 })
35
36 export default i18n