forked from yearn/ygov-finance
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathi18n.js
41 lines (35 loc) · 932 Bytes
/
i18n.js
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
import i18n from "i18next";
import detector from "i18next-browser-languagedetector";
import { reactI18nextModule } from "react-i18next";
import translationEN from './locales/en/translation.json';
import translationZH from './locales/zh/translation.json';
import translationJA from './locales/ja/translation.json';
import translationTH from './locales/th/translation.json';
// the translations
const resources = {
en: {
translation: translationEN
},
zh: {
translation: translationZH
},
ja: {
translation: translationJA
},
th: {
translation: translationTH
}
};
i18n
.use(detector)
.use(reactI18nextModule) // passes i18n down to react-i18next
.init({
resources,
// lng: "en",
fallbackLng: "en",
keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false // react already safes from xss
}
});
export default i18n;