-
Notifications
You must be signed in to change notification settings - Fork 0
/
i18n.js
38 lines (36 loc) · 993 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
import i18n from 'i18next'
import LanguageDetector from "i18next-browser-languagedetector"
import {initReactI18next} from 'react-i18next'
import XHR from 'i18next-xhr-backend'
import languageEN from './lang/en/translate.json'
import languageAR from './lang/ar/translate.json'
i18n
.use(XHR)
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
en: languageEN,
ar: languageAR
},
/* default language when load the website in browser */
lng: "en",
/* When react i18next not finding any language to as default in borwser */
fallbackLng: "en",
/* debugger For Development environment */
debug: false,
ns: ["translations"],
defaultNS: "translations",
keySeparator: ".",
interpolation: {
escapeValue: false,
formatSeparator: ","
},
react: {
wait: true,
bindI18n: 'languageChanged loaded',
bindStore: 'added removed',
nsMode: 'default'
}
})
export default i18n;