-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi18n.js
42 lines (37 loc) · 960 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
42
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
// the translations
// (tip move them in a JSON file and import them)
const resources = {
en: {
translation: {
"more": "More",
"recommend_for_you": "Recommend For You",
"todays_deal": "Today's Deal",
"featured_products": "Featured Products",
"login_btn": "Login",
"max_studio": "iEuclid"
}
},
cn: {
translation: {
"more": "更多",
"recommend_for_you": "每日推荐",
"todays_deal": "今日特卖",
"featured_products": "精选好物",
"login_btn": "登录",
"max_studio": "iEuclid"
}
}
};
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
lng: "en",
keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false // react already safes from xss
}
});
export default i18n;