]> Untitled Git - lemmy-ui.git/blob - src/shared/i18next.ts
Add Korean language
[lemmy-ui.git] / src / shared / i18next.ts
1 import i18next, { i18nTyped } 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 import { km } from "./translations/km";
29 import { ga } from "./translations/ga";
30 import { sr_Latn } from "./translations/sr_Latn";
31 import { da } from "./translations/da";
32 import { oc } from "./translations/oc";
33 import { hr } from "./translations/hr";
34 import { th } from "./translations/th";
35 import { bg } from "./translations/bg";
36 import { ko } from "./translations/ko";
37
38 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
39 const resources = {
40   en,
41   el,
42   eu,
43   eo,
44   es,
45   ka,
46   hi,
47   de,
48   zh,
49   fr,
50   sv,
51   ru,
52   nl,
53   it,
54   fi,
55   ca,
56   fa,
57   pl,
58   pt_BR,
59   ja,
60   gl,
61   tr,
62   hu,
63   uk,
64   sq,
65   km,
66   ga,
67   sr_Latn,
68   da,
69   oc,
70   hr,
71   th,
72   bg,
73   ko,
74 };
75
76 function format(value: any, format: any): any {
77   return format === "uppercase" ? value.toUpperCase() : value;
78 }
79
80 i18next.init({
81   debug: false,
82   // load: 'languageOnly',
83
84   // initImmediate: false,
85   lng: getLanguage(),
86   fallbackLng: "en",
87   resources,
88   interpolation: { format },
89 });
90
91 export const i18n = i18next as i18nTyped;
92
93 export { resources };