]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Italian complete translation
[lemmy.git] / ui / src / i18next.ts
1 import * as i18n from 'i18next';
2 import { getLanguage } from './utils';
3 import { en } from './translations/en';
4 import { eo } from './translations/eo';
5 import { es } from './translations/es';
6 import { de } from './translations/de';
7 import { fr } from './translations/fr';
8 import { sv } from './translations/sv';
9 import { ru } from './translations/ru';
10 import { zh } from './translations/zh';
11 import { nl } from './translations/nl';
12 import { it } from './translations/it';
13
14 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
15 // TODO don't forget to add moment locales for new languages.
16 const resources = {
17   en,
18   eo,
19   es,
20   de,
21   zh,
22   fr,
23   sv,
24   ru,
25   nl,
26   it,
27 }
28
29 function format(value: any, format: any, lng: any) {
30         if (format === 'uppercase') return value.toUpperCase();
31         return value;
32 }
33
34 i18n
35 .init({
36   debug: true,
37   // load: 'languageOnly',
38
39   // initImmediate: false,
40   lng: getLanguage(),
41   fallbackLng: 'en',
42         resources,
43         interpolation: {
44     format: format
45
46   }
47 });
48
49 export { i18n, resources };