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