]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Adding Greek and Basque languages for weblate.
[lemmy.git] / ui / src / i18next.ts
1 import i18next from 'i18next';
2 import { getLanguage } from './utils';
3 import { en } from './translations/en';
4 import { el } from './translations/el';
5 import { eu } from './translations/eu';
6 import { eo } from './translations/eo';
7 import { es } from './translations/es';
8 import { de } from './translations/de';
9 import { fr } from './translations/fr';
10 import { sv } from './translations/sv';
11 import { ru } from './translations/ru';
12 import { zh } from './translations/zh';
13 import { nl } from './translations/nl';
14 import { it } from './translations/it';
15 import { fi } from './translations/fi';
16 import { ca } from './translations/ca';
17 import { fa } from './translations/fa';
18 import { hi } from './translations/hi';
19 import { pt_BR } from './translations/pt_BR';
20 import { ja } from './translations/ja';
21 import { ka } from './translations/ka';
22
23 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
24 const resources = {
25   en,
26   el,
27   eu,
28   eo,
29   es,
30   ka,
31   hi,
32   de,
33   zh,
34   fr,
35   sv,
36   ru,
37   nl,
38   it,
39   fi,
40   ca,
41   fa,
42   pt_BR,
43   ja,
44 };
45
46 function format(value: any, format: any, lng: any): any {
47   return format === 'uppercase' ? value.toUpperCase() : value;
48 }
49
50 i18next.init({
51   debug: false,
52   // load: 'languageOnly',
53
54   // initImmediate: false,
55   lng: getLanguage(),
56   fallbackLng: 'en',
57   resources,
58   interpolation: { format },
59 });
60
61 export { i18next as i18n, resources };