]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Adding Albanian 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 { pl } from './translations/pl';
20 import { pt_BR } from './translations/pt_BR';
21 import { ja } from './translations/ja';
22 import { ka } from './translations/ka';
23 import { gl } from './translations/gl';
24 import { tr } from './translations/tr';
25 import { hu } from './translations/hu';
26 import { uk } from './translations/uk';
27 import { sq } from './translations/sq';
28
29 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
30 const resources = {
31   en,
32   el,
33   eu,
34   eo,
35   es,
36   ka,
37   hi,
38   de,
39   zh,
40   fr,
41   sv,
42   ru,
43   nl,
44   it,
45   fi,
46   ca,
47   fa,
48   pl,
49   pt_BR,
50   ja,
51   gl,
52   tr,
53   hu,
54   uk,
55   sq,
56 };
57
58 function format(value: any, format: any, lng: any): any {
59   return format === 'uppercase' ? value.toUpperCase() : value;
60 }
61
62 i18next.init({
63   debug: false,
64   // load: 'languageOnly',
65
66   // initImmediate: false,
67   lng: getLanguage(),
68   fallbackLng: 'en',
69   resources,
70   interpolation: { format },
71 });
72
73 export { i18next as i18n, resources };