-
Notifications
You must be signed in to change notification settings - Fork 255
/
i18n.js
66 lines (62 loc) · 1.68 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { createInstance } from 'i18next';
import { initReactI18next } from 'react-i18next';
import ar from './locales/ar/translation.json';
import de from './locales/de/translation.json';
import en from './locales/en/translation.json';
import et from './locales/et/translation.json';
import fa from './locales/fa/translation.json';
import zhCn from './locales/zhCn/translation.json';
import zhTw from './locales/zhTw/translation.json';
import fr from './locales/fr/translation.json';
import hr from './locales/hr/translation.json';
import ja from './locales/ja/translation.json';
import kr from './locales/kr/translation.json';
import nl from './locales/nl/translation.json';
import pl from './locales/pl/translation.json';
import ptBr from './locales/ptBr/translation.json';
import it from './locales/it/translation.json';
import sr from './locales/sr/translation.json';
import sv from './locales/sv/translation.json';
import lt from './locales/lt/translation.json';
import vi from './locales/vi/translation.json';
import bg from './locales/bg/translation.json';
import nbNo from './locales/nbNo/translation.json';
/**
* Load translations for each language
*/
function createI18nInstance() {
const resources = {
ar,
bg,
de,
en,
et,
fa,
fr,
hr,
it,
ja,
kr,
lt,
'nb-NO': nbNo,
nl,
pl,
'pt-BR': ptBr,
sr,
sv,
vi,
'zh-CN': zhCn,
'zh-TW': zhTw,
};
const instance = createInstance();
instance.use(initReactI18next).init({
fallbackLng: 'en',
interpolation: {
escapeValue: false, // react is already safe from xss
},
lng: 'en',
resources,
});
return instance;
}
export default createI18nInstance;