]> Untitled Git - lemmy.git/blob - ui/src/i18next.ts
Adding finnish to moment, dropdown.
[lemmy.git] / ui / src / i18next.ts
1 import i18next 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 import { fi } from './translations/fi';
14
15 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
16 const resources = {
17   en,
18   eo,
19   es,
20   de,
21   zh,
22   fr,
23   sv,
24   ru,
25   nl,
26   it,
27   fi,
28 };
29
30 function format(value: any, format: any, lng: any) {
31   if (format === 'uppercase') return value.toUpperCase();
32   return value;
33 }
34
35 i18next.init({
36   debug: false,
37   // load: 'languageOnly',
38
39   // initImmediate: false,
40   lng: getLanguage(),
41   fallbackLng: 'en',
42   resources,
43   interpolation: {
44     format: format,
45   },
46 });
47
48 export { i18next as i18n, resources };