forked from xdan/jodit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanguages.ts
More file actions
98 lines (86 loc) · 1.98 KB
/
Copy pathlanguages.ts
File metadata and controls
98 lines (86 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* [[include:langs/README.md]]
* @packageDocumentation
* @module langs
*/
// @ts-nocheck
import type { IDictionary } from 'jodit/types';
import { isArray } from 'jodit/core/helpers/checker/is-array';
import ar from 'jodit/langs/ar';
import cs_cz from 'jodit/langs/cs_cz';
import de from 'jodit/langs/de';
import en from 'jodit/langs/en';
import es from 'jodit/langs/es';
import fi from 'jodit/langs/fi';
import fr from 'jodit/langs/fr';
import he from 'jodit/langs/he';
import hu from 'jodit/langs/hu';
import id from 'jodit/langs/id';
import it from 'jodit/langs/it';
import ja from 'jodit/langs/ja';
import keys from 'jodit/langs/keys';
import ko from 'jodit/langs/ko';
import mn from 'jodit/langs/mn';
import nl from 'jodit/langs/nl';
import no from 'jodit/langs/no';
import pl from 'jodit/langs/pl';
import pt_br from 'jodit/langs/pt_br';
import ru from 'jodit/langs/ru';
import sk from 'jodit/langs/sk';
import tr from 'jodit/langs/tr';
import ua from 'jodit/langs/ua';
import zh_cn from 'jodit/langs/zh_cn';
import zh_tw from 'jodit/langs/zh_tw';
let exp: IDictionary<IDictionary<string>> = {};
exp = {
ar,
cs_cz,
de,
en,
es,
fi,
fr,
he,
hu,
id,
it,
ja,
ko,
mn,
nl,
no,
pl,
pt_br,
ru,
sk,
tr,
ua,
zh_cn,
zh_tw
};
/* Unpack array to hash */
const get = (value: IDictionary): IDictionary =>
value ? value.default || value : {},
hashLang: IDictionary = {};
if (isArray(get(keys))) {
get(keys).forEach((key: string, index: number) => {
hashLang[index] = key;
});
}
Object.keys(exp).forEach((lang: string) => {
const list: unknown = get(exp[lang]);
if (isArray(list)) {
exp[lang] = {};
list.forEach((value: string, index: number) => {
exp[lang][hashLang[index]] = value;
});
} else {
exp[lang] = list as IDictionary;
}
});
export default exp;