@adminforth/i18n 1.1.3-next.4 → 1.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log +4 -2
- package/custom/datepickerLocales.ts +81 -0
- package/custom/dayjsLocales.ts +145 -0
- package/custom/langCommon.ts +20 -0
- package/dist/custom/datepickerLocales.ts +81 -0
- package/dist/custom/dayjsLocales.ts +145 -0
- package/dist/custom/langCommon.ts +20 -0
- package/dist/index.js +18 -13
- package/index.ts +21 -14
- package/package.json +1 -1
- package/types.ts +6 -0
package/build.log
CHANGED
|
@@ -9,10 +9,12 @@ custom/LanguageInUserMenu.vue
|
|
|
9
9
|
custom/LanguageUnderLogin.vue
|
|
10
10
|
custom/ListCell.vue
|
|
11
11
|
custom/SingleMultiInput.vue
|
|
12
|
+
custom/datepickerLocales.ts
|
|
13
|
+
custom/dayjsLocales.ts
|
|
12
14
|
custom/langCommon.ts
|
|
13
15
|
custom/package-lock.json
|
|
14
16
|
custom/package.json
|
|
15
17
|
custom/tsconfig.json
|
|
16
18
|
|
|
17
|
-
sent
|
|
18
|
-
total size is
|
|
19
|
+
sent 24,836 bytes received 229 bytes 50,130.00 bytes/sec
|
|
20
|
+
total size is 23,969 speedup is 0.96
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"ar": import('/node_modules/flowbite-datepicker/js/i18n/locales/ar.js'),
|
|
3
|
+
"ar-tn": import('/node_modules/flowbite-datepicker/js/i18n/locales/ar-tn.js'),
|
|
4
|
+
"az": import('/node_modules/flowbite-datepicker/js/i18n/locales/az.js'),
|
|
5
|
+
"bg": import('/node_modules/flowbite-datepicker/js/i18n/locales/bg.js'),
|
|
6
|
+
"bm": import('/node_modules/flowbite-datepicker/js/i18n/locales/bm.js'),
|
|
7
|
+
"bn": import('/node_modules/flowbite-datepicker/js/i18n/locales/bn.js'),
|
|
8
|
+
"br": import('/node_modules/flowbite-datepicker/js/i18n/locales/br.js'),
|
|
9
|
+
"bs": import('/node_modules/flowbite-datepicker/js/i18n/locales/bs.js'),
|
|
10
|
+
"ca": import('/node_modules/flowbite-datepicker/js/i18n/locales/ca.js'),
|
|
11
|
+
"cs": import('/node_modules/flowbite-datepicker/js/i18n/locales/cs.js'),
|
|
12
|
+
"cy": import('/node_modules/flowbite-datepicker/js/i18n/locales/cy.js'),
|
|
13
|
+
"da": import('/node_modules/flowbite-datepicker/js/i18n/locales/da.js'),
|
|
14
|
+
"de": import('/node_modules/flowbite-datepicker/js/i18n/locales/de.js'),
|
|
15
|
+
"el": import('/node_modules/flowbite-datepicker/js/i18n/locales/el.js'),
|
|
16
|
+
"en-AU": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-AU.js'),
|
|
17
|
+
"en-CA": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-CA.js'),
|
|
18
|
+
"en-GB": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-GB.js'),
|
|
19
|
+
"en-IE": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-IE.js'),
|
|
20
|
+
"en-NZ": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-NZ.js'),
|
|
21
|
+
"en-ZA": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-ZA.js'),
|
|
22
|
+
"eo": import('/node_modules/flowbite-datepicker/js/i18n/locales/eo.js'),
|
|
23
|
+
"es": import('/node_modules/flowbite-datepicker/js/i18n/locales/es.js'),
|
|
24
|
+
"et": import('/node_modules/flowbite-datepicker/js/i18n/locales/et.js'),
|
|
25
|
+
"eu": import('/node_modules/flowbite-datepicker/js/i18n/locales/eu.js'),
|
|
26
|
+
"fa": import('/node_modules/flowbite-datepicker/js/i18n/locales/fa.js'),
|
|
27
|
+
"fi": import('/node_modules/flowbite-datepicker/js/i18n/locales/fi.js'),
|
|
28
|
+
"fo": import('/node_modules/flowbite-datepicker/js/i18n/locales/fo.js'),
|
|
29
|
+
"fr-CH": import('/node_modules/flowbite-datepicker/js/i18n/locales/fr-CH.js'),
|
|
30
|
+
"fr": import('/node_modules/flowbite-datepicker/js/i18n/locales/fr.js'),
|
|
31
|
+
"gl": import('/node_modules/flowbite-datepicker/js/i18n/locales/gl.js'),
|
|
32
|
+
"he": import('/node_modules/flowbite-datepicker/js/i18n/locales/he.js'),
|
|
33
|
+
"hi": import('/node_modules/flowbite-datepicker/js/i18n/locales/hi.js'),
|
|
34
|
+
"hr": import('/node_modules/flowbite-datepicker/js/i18n/locales/hr.js'),
|
|
35
|
+
"hu": import('/node_modules/flowbite-datepicker/js/i18n/locales/hu.js'),
|
|
36
|
+
"hy": import('/node_modules/flowbite-datepicker/js/i18n/locales/hy.js'),
|
|
37
|
+
"id": import('/node_modules/flowbite-datepicker/js/i18n/locales/id.js'),
|
|
38
|
+
"is": import('/node_modules/flowbite-datepicker/js/i18n/locales/is.js'),
|
|
39
|
+
"it-CH": import('/node_modules/flowbite-datepicker/js/i18n/locales/it-CH.js'),
|
|
40
|
+
"it": import('/node_modules/flowbite-datepicker/js/i18n/locales/it.js'),
|
|
41
|
+
"ja": import('/node_modules/flowbite-datepicker/js/i18n/locales/ja.js'),
|
|
42
|
+
"ka": import('/node_modules/flowbite-datepicker/js/i18n/locales/ka.js'),
|
|
43
|
+
"kk": import('/node_modules/flowbite-datepicker/js/i18n/locales/kk.js'),
|
|
44
|
+
"km": import('/node_modules/flowbite-datepicker/js/i18n/locales/km.js'),
|
|
45
|
+
"ko": import('/node_modules/flowbite-datepicker/js/i18n/locales/ko.js'),
|
|
46
|
+
"lt": import('/node_modules/flowbite-datepicker/js/i18n/locales/lt.js'),
|
|
47
|
+
"lv": import('/node_modules/flowbite-datepicker/js/i18n/locales/lv.js'),
|
|
48
|
+
"me": import('/node_modules/flowbite-datepicker/js/i18n/locales/me.js'),
|
|
49
|
+
"mk": import('/node_modules/flowbite-datepicker/js/i18n/locales/mk.js'),
|
|
50
|
+
"mn": import('/node_modules/flowbite-datepicker/js/i18n/locales/mn.js'),
|
|
51
|
+
"mr": import('/node_modules/flowbite-datepicker/js/i18n/locales/mr.js'),
|
|
52
|
+
"ms": import('/node_modules/flowbite-datepicker/js/i18n/locales/ms.js'),
|
|
53
|
+
"nl-BE": import('/node_modules/flowbite-datepicker/js/i18n/locales/nl-BE.js'),
|
|
54
|
+
"nl": import('/node_modules/flowbite-datepicker/js/i18n/locales/nl.js'),
|
|
55
|
+
"no": import('/node_modules/flowbite-datepicker/js/i18n/locales/no.js'),
|
|
56
|
+
"oc": import('/node_modules/flowbite-datepicker/js/i18n/locales/oc.js'),
|
|
57
|
+
"pl": import('/node_modules/flowbite-datepicker/js/i18n/locales/pl.js'),
|
|
58
|
+
"pt-BR": import('/node_modules/flowbite-datepicker/js/i18n/locales/pt-BR.js'),
|
|
59
|
+
"pt": import('/node_modules/flowbite-datepicker/js/i18n/locales/pt.js'),
|
|
60
|
+
"ro": import('/node_modules/flowbite-datepicker/js/i18n/locales/ro.js'),
|
|
61
|
+
"ru": import('/node_modules/flowbite-datepicker/js/i18n/locales/ru.js'),
|
|
62
|
+
"si": import('/node_modules/flowbite-datepicker/js/i18n/locales/si.js'),
|
|
63
|
+
"sk": import('/node_modules/flowbite-datepicker/js/i18n/locales/sk.js'),
|
|
64
|
+
"sl": import('/node_modules/flowbite-datepicker/js/i18n/locales/sl.js'),
|
|
65
|
+
"sq": import('/node_modules/flowbite-datepicker/js/i18n/locales/sq.js'),
|
|
66
|
+
"sr": import('/node_modules/flowbite-datepicker/js/i18n/locales/sr.js'),
|
|
67
|
+
"sr-latn": import('/node_modules/flowbite-datepicker/js/i18n/locales/sr-latn.js'),
|
|
68
|
+
"sv": import('/node_modules/flowbite-datepicker/js/i18n/locales/sv.js'),
|
|
69
|
+
"sw": import('/node_modules/flowbite-datepicker/js/i18n/locales/sw.js'),
|
|
70
|
+
"ta": import('/node_modules/flowbite-datepicker/js/i18n/locales/ta.js'),
|
|
71
|
+
"tg": import('/node_modules/flowbite-datepicker/js/i18n/locales/tg.js'),
|
|
72
|
+
"th": import('/node_modules/flowbite-datepicker/js/i18n/locales/th.js'),
|
|
73
|
+
"tk": import('/node_modules/flowbite-datepicker/js/i18n/locales/tk.js'),
|
|
74
|
+
"tr": import('/node_modules/flowbite-datepicker/js/i18n/locales/tr.js'),
|
|
75
|
+
"uk": import('/node_modules/flowbite-datepicker/js/i18n/locales/uk.js'),
|
|
76
|
+
"uz-cyrl": import('/node_modules/flowbite-datepicker/js/i18n/locales/uz-cyrl.js'),
|
|
77
|
+
"uz-latn": import('/node_modules/flowbite-datepicker/js/i18n/locales/uz-latn.js'),
|
|
78
|
+
"vi": import('/node_modules/flowbite-datepicker/js/i18n/locales/vi.js'),
|
|
79
|
+
"zh-CN": import('/node_modules/flowbite-datepicker/js/i18n/locales/zh-CN.js'),
|
|
80
|
+
"zh-TW": import('/node_modules/flowbite-datepicker/js/i18n/locales/zh-TW.js'),
|
|
81
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"af": import('dayjs/locale/af'),
|
|
3
|
+
"am": import('dayjs/locale/am'),
|
|
4
|
+
"ar-dz": import('dayjs/locale/ar-dz'),
|
|
5
|
+
"ar-iq": import('dayjs/locale/ar-iq'),
|
|
6
|
+
"ar-kw": import('dayjs/locale/ar-kw'),
|
|
7
|
+
"ar-ly": import('dayjs/locale/ar-ly'),
|
|
8
|
+
"ar-ma": import('dayjs/locale/ar-ma'),
|
|
9
|
+
"ar-sa": import('dayjs/locale/ar-sa'),
|
|
10
|
+
"ar-tn": import('dayjs/locale/ar-tn'),
|
|
11
|
+
"ar": import('dayjs/locale/ar'),
|
|
12
|
+
"az": import('dayjs/locale/az'),
|
|
13
|
+
"be": import('dayjs/locale/be'),
|
|
14
|
+
"bg": import('dayjs/locale/bg'),
|
|
15
|
+
"bi": import('dayjs/locale/bi'),
|
|
16
|
+
"bm": import('dayjs/locale/bm'),
|
|
17
|
+
"bn-bd": import('dayjs/locale/bn-bd'),
|
|
18
|
+
"bn": import('dayjs/locale/bn'),
|
|
19
|
+
"bo": import('dayjs/locale/bo'),
|
|
20
|
+
"br": import('dayjs/locale/br'),
|
|
21
|
+
"bs": import('dayjs/locale/bs'),
|
|
22
|
+
"ca": import('dayjs/locale/ca'),
|
|
23
|
+
"cs": import('dayjs/locale/cs'),
|
|
24
|
+
"cv": import('dayjs/locale/cv'),
|
|
25
|
+
"cy": import('dayjs/locale/cy'),
|
|
26
|
+
"da": import('dayjs/locale/da'),
|
|
27
|
+
"de-at": import('dayjs/locale/de-at'),
|
|
28
|
+
"de-ch": import('dayjs/locale/de-ch'),
|
|
29
|
+
"de": import('dayjs/locale/de'),
|
|
30
|
+
"dv": import('dayjs/locale/dv'),
|
|
31
|
+
"el": import('dayjs/locale/el'),
|
|
32
|
+
"en-au": import('dayjs/locale/en-au'),
|
|
33
|
+
"en-ca": import('dayjs/locale/en-ca'),
|
|
34
|
+
"en-gb": import('dayjs/locale/en-gb'),
|
|
35
|
+
"en-ie": import('dayjs/locale/en-ie'),
|
|
36
|
+
"en-il": import('dayjs/locale/en-il'),
|
|
37
|
+
"en-in": import('dayjs/locale/en-in'),
|
|
38
|
+
"en-nz": import('dayjs/locale/en-nz'),
|
|
39
|
+
"en-sg": import('dayjs/locale/en-sg'),
|
|
40
|
+
"en-tt": import('dayjs/locale/en-tt'),
|
|
41
|
+
"en": import('dayjs/locale/en'),
|
|
42
|
+
"eo": import('dayjs/locale/eo'),
|
|
43
|
+
"es-do": import('dayjs/locale/es-do'),
|
|
44
|
+
"es-mx": import('dayjs/locale/es-mx'),
|
|
45
|
+
"es-pr": import('dayjs/locale/es-pr'),
|
|
46
|
+
"es-us": import('dayjs/locale/es-us'),
|
|
47
|
+
"es": import('dayjs/locale/es'),
|
|
48
|
+
"et": import('dayjs/locale/et'),
|
|
49
|
+
"eu": import('dayjs/locale/eu'),
|
|
50
|
+
"fa": import('dayjs/locale/fa'),
|
|
51
|
+
"fi": import('dayjs/locale/fi'),
|
|
52
|
+
"fo": import('dayjs/locale/fo'),
|
|
53
|
+
"fr-ca": import('dayjs/locale/fr-ca'),
|
|
54
|
+
"fr-ch": import('dayjs/locale/fr-ch'),
|
|
55
|
+
"fr": import('dayjs/locale/fr'),
|
|
56
|
+
"fy": import('dayjs/locale/fy'),
|
|
57
|
+
"ga": import('dayjs/locale/ga'),
|
|
58
|
+
"gd": import('dayjs/locale/gd'),
|
|
59
|
+
"gl": import('dayjs/locale/gl'),
|
|
60
|
+
"gom-latn": import('dayjs/locale/gom-latn'),
|
|
61
|
+
"gu": import('dayjs/locale/gu'),
|
|
62
|
+
"he": import('dayjs/locale/he'),
|
|
63
|
+
"hi": import('dayjs/locale/hi'),
|
|
64
|
+
"hr": import('dayjs/locale/hr'),
|
|
65
|
+
"ht": import('dayjs/locale/ht'),
|
|
66
|
+
"hu": import('dayjs/locale/hu'),
|
|
67
|
+
"hy-am": import('dayjs/locale/hy-am'),
|
|
68
|
+
"id": import('dayjs/locale/id'),
|
|
69
|
+
"is": import('dayjs/locale/is'),
|
|
70
|
+
"it-ch": import('dayjs/locale/it-ch'),
|
|
71
|
+
"it": import('dayjs/locale/it'),
|
|
72
|
+
"ja": import('dayjs/locale/ja'),
|
|
73
|
+
"jv": import('dayjs/locale/jv'),
|
|
74
|
+
"ka": import('dayjs/locale/ka'),
|
|
75
|
+
"kk": import('dayjs/locale/kk'),
|
|
76
|
+
"km": import('dayjs/locale/km'),
|
|
77
|
+
"kn": import('dayjs/locale/kn'),
|
|
78
|
+
"ko": import('dayjs/locale/ko'),
|
|
79
|
+
"ku": import('dayjs/locale/ku'),
|
|
80
|
+
"ky": import('dayjs/locale/ky'),
|
|
81
|
+
"lb": import('dayjs/locale/lb'),
|
|
82
|
+
"lo": import('dayjs/locale/lo'),
|
|
83
|
+
"lt": import('dayjs/locale/lt'),
|
|
84
|
+
"lv": import('dayjs/locale/lv'),
|
|
85
|
+
"me": import('dayjs/locale/me'),
|
|
86
|
+
"mi": import('dayjs/locale/mi'),
|
|
87
|
+
"mk": import('dayjs/locale/mk'),
|
|
88
|
+
"ml": import('dayjs/locale/ml'),
|
|
89
|
+
"mn": import('dayjs/locale/mn'),
|
|
90
|
+
"mr": import('dayjs/locale/mr'),
|
|
91
|
+
"ms-my": import('dayjs/locale/ms-my'),
|
|
92
|
+
"ms": import('dayjs/locale/ms'),
|
|
93
|
+
"mt": import('dayjs/locale/mt'),
|
|
94
|
+
"my": import('dayjs/locale/my'),
|
|
95
|
+
"nb": import('dayjs/locale/nb'),
|
|
96
|
+
"ne": import('dayjs/locale/ne'),
|
|
97
|
+
"nl-be": import('dayjs/locale/nl-be'),
|
|
98
|
+
"nl": import('dayjs/locale/nl'),
|
|
99
|
+
"nn": import('dayjs/locale/nn'),
|
|
100
|
+
"oc-lnc": import('dayjs/locale/oc-lnc'),
|
|
101
|
+
"pa-in": import('dayjs/locale/pa-in'),
|
|
102
|
+
"pl": import('dayjs/locale/pl'),
|
|
103
|
+
"pt-br": import('dayjs/locale/pt-br'),
|
|
104
|
+
"pt": import('dayjs/locale/pt'),
|
|
105
|
+
"rn": import('dayjs/locale/rn'),
|
|
106
|
+
"ro": import('dayjs/locale/ro'),
|
|
107
|
+
"ru": import('dayjs/locale/ru'),
|
|
108
|
+
"rw": import('dayjs/locale/rw'),
|
|
109
|
+
"sd": import('dayjs/locale/sd'),
|
|
110
|
+
"se": import('dayjs/locale/se'),
|
|
111
|
+
"si": import('dayjs/locale/si'),
|
|
112
|
+
"sk": import('dayjs/locale/sk'),
|
|
113
|
+
"sl": import('dayjs/locale/sl'),
|
|
114
|
+
"sq": import('dayjs/locale/sq'),
|
|
115
|
+
"sr-cyrl": import('dayjs/locale/sr-cyrl'),
|
|
116
|
+
"sr": import('dayjs/locale/sr'),
|
|
117
|
+
"ss": import('dayjs/locale/ss'),
|
|
118
|
+
"sv-fi": import('dayjs/locale/sv-fi'),
|
|
119
|
+
"sv": import('dayjs/locale/sv'),
|
|
120
|
+
"sw": import('dayjs/locale/sw'),
|
|
121
|
+
"ta": import('dayjs/locale/ta'),
|
|
122
|
+
"te": import('dayjs/locale/te'),
|
|
123
|
+
"tet": import('dayjs/locale/tet'),
|
|
124
|
+
"tg": import('dayjs/locale/tg'),
|
|
125
|
+
"th": import('dayjs/locale/th'),
|
|
126
|
+
"tk": import('dayjs/locale/tk'),
|
|
127
|
+
"tl-ph": import('dayjs/locale/tl-ph'),
|
|
128
|
+
"tlh": import('dayjs/locale/tlh'),
|
|
129
|
+
"tr": import('dayjs/locale/tr'),
|
|
130
|
+
"tzl": import('dayjs/locale/tzl'),
|
|
131
|
+
"tzm-latn": import('dayjs/locale/tzm-latn'),
|
|
132
|
+
"tzm": import('dayjs/locale/tzm'),
|
|
133
|
+
"ug-cn": import('dayjs/locale/ug-cn'),
|
|
134
|
+
"uk": import('dayjs/locale/uk'),
|
|
135
|
+
"ur": import('dayjs/locale/ur'),
|
|
136
|
+
"uz-latn": import('dayjs/locale/uz-latn'),
|
|
137
|
+
"uz": import('dayjs/locale/uz'),
|
|
138
|
+
"vi": import('dayjs/locale/vi'),
|
|
139
|
+
"x-pseudo": import('dayjs/locale/x-pseudo'),
|
|
140
|
+
"yo": import('dayjs/locale/yo'),
|
|
141
|
+
"zh-cn": import('dayjs/locale/zh-cn'),
|
|
142
|
+
"zh-hk": import('dayjs/locale/zh-hk'),
|
|
143
|
+
"zh-tw": import('dayjs/locale/zh-tw'),
|
|
144
|
+
"zh": import('dayjs/locale/zh'),
|
|
145
|
+
};
|
package/custom/langCommon.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { callAdminForthApi } from '@/utils';
|
|
3
|
+
import dayjsLocales from './dayjsLocales';
|
|
4
|
+
import datepickerLocales from './datepickerLocales';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import Datepicker from "flowbite-datepicker/Datepicker";
|
|
3
7
|
|
|
4
8
|
|
|
5
9
|
const messagesCache: Record<
|
|
@@ -33,6 +37,22 @@ export async function setLang({ setLocaleMessage, locale }: any, pluginInstanceI
|
|
|
33
37
|
messages: messages
|
|
34
38
|
};
|
|
35
39
|
}
|
|
40
|
+
|
|
41
|
+
// set dayjs locale
|
|
42
|
+
try {
|
|
43
|
+
await dayjsLocales[langIso];
|
|
44
|
+
dayjs.locale(langIso);
|
|
45
|
+
} catch {
|
|
46
|
+
dayjs.locale('en');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// set datepicker locale
|
|
50
|
+
if (datepickerLocales[langIso]) {
|
|
51
|
+
Datepicker.locales[langIso] = (await datepickerLocales[langIso]).default[langIso];
|
|
52
|
+
} else if (Object.keys(datepickerLocales).some((l) => l.startsWith(`${langIso}-`)) && langIso !== 'en') {
|
|
53
|
+
const lang = Object.keys(datepickerLocales).find((l) => l.startsWith(`${langIso}-`));
|
|
54
|
+
Datepicker.locales[langIso] = (await datepickerLocales[lang]).default[lang];
|
|
55
|
+
}
|
|
36
56
|
|
|
37
57
|
// set locale and locale message
|
|
38
58
|
setLocaleMessage(langIso, messagesCache[langIso].messages);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"ar": import('/node_modules/flowbite-datepicker/js/i18n/locales/ar.js'),
|
|
3
|
+
"ar-tn": import('/node_modules/flowbite-datepicker/js/i18n/locales/ar-tn.js'),
|
|
4
|
+
"az": import('/node_modules/flowbite-datepicker/js/i18n/locales/az.js'),
|
|
5
|
+
"bg": import('/node_modules/flowbite-datepicker/js/i18n/locales/bg.js'),
|
|
6
|
+
"bm": import('/node_modules/flowbite-datepicker/js/i18n/locales/bm.js'),
|
|
7
|
+
"bn": import('/node_modules/flowbite-datepicker/js/i18n/locales/bn.js'),
|
|
8
|
+
"br": import('/node_modules/flowbite-datepicker/js/i18n/locales/br.js'),
|
|
9
|
+
"bs": import('/node_modules/flowbite-datepicker/js/i18n/locales/bs.js'),
|
|
10
|
+
"ca": import('/node_modules/flowbite-datepicker/js/i18n/locales/ca.js'),
|
|
11
|
+
"cs": import('/node_modules/flowbite-datepicker/js/i18n/locales/cs.js'),
|
|
12
|
+
"cy": import('/node_modules/flowbite-datepicker/js/i18n/locales/cy.js'),
|
|
13
|
+
"da": import('/node_modules/flowbite-datepicker/js/i18n/locales/da.js'),
|
|
14
|
+
"de": import('/node_modules/flowbite-datepicker/js/i18n/locales/de.js'),
|
|
15
|
+
"el": import('/node_modules/flowbite-datepicker/js/i18n/locales/el.js'),
|
|
16
|
+
"en-AU": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-AU.js'),
|
|
17
|
+
"en-CA": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-CA.js'),
|
|
18
|
+
"en-GB": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-GB.js'),
|
|
19
|
+
"en-IE": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-IE.js'),
|
|
20
|
+
"en-NZ": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-NZ.js'),
|
|
21
|
+
"en-ZA": import('/node_modules/flowbite-datepicker/js/i18n/locales/en-ZA.js'),
|
|
22
|
+
"eo": import('/node_modules/flowbite-datepicker/js/i18n/locales/eo.js'),
|
|
23
|
+
"es": import('/node_modules/flowbite-datepicker/js/i18n/locales/es.js'),
|
|
24
|
+
"et": import('/node_modules/flowbite-datepicker/js/i18n/locales/et.js'),
|
|
25
|
+
"eu": import('/node_modules/flowbite-datepicker/js/i18n/locales/eu.js'),
|
|
26
|
+
"fa": import('/node_modules/flowbite-datepicker/js/i18n/locales/fa.js'),
|
|
27
|
+
"fi": import('/node_modules/flowbite-datepicker/js/i18n/locales/fi.js'),
|
|
28
|
+
"fo": import('/node_modules/flowbite-datepicker/js/i18n/locales/fo.js'),
|
|
29
|
+
"fr-CH": import('/node_modules/flowbite-datepicker/js/i18n/locales/fr-CH.js'),
|
|
30
|
+
"fr": import('/node_modules/flowbite-datepicker/js/i18n/locales/fr.js'),
|
|
31
|
+
"gl": import('/node_modules/flowbite-datepicker/js/i18n/locales/gl.js'),
|
|
32
|
+
"he": import('/node_modules/flowbite-datepicker/js/i18n/locales/he.js'),
|
|
33
|
+
"hi": import('/node_modules/flowbite-datepicker/js/i18n/locales/hi.js'),
|
|
34
|
+
"hr": import('/node_modules/flowbite-datepicker/js/i18n/locales/hr.js'),
|
|
35
|
+
"hu": import('/node_modules/flowbite-datepicker/js/i18n/locales/hu.js'),
|
|
36
|
+
"hy": import('/node_modules/flowbite-datepicker/js/i18n/locales/hy.js'),
|
|
37
|
+
"id": import('/node_modules/flowbite-datepicker/js/i18n/locales/id.js'),
|
|
38
|
+
"is": import('/node_modules/flowbite-datepicker/js/i18n/locales/is.js'),
|
|
39
|
+
"it-CH": import('/node_modules/flowbite-datepicker/js/i18n/locales/it-CH.js'),
|
|
40
|
+
"it": import('/node_modules/flowbite-datepicker/js/i18n/locales/it.js'),
|
|
41
|
+
"ja": import('/node_modules/flowbite-datepicker/js/i18n/locales/ja.js'),
|
|
42
|
+
"ka": import('/node_modules/flowbite-datepicker/js/i18n/locales/ka.js'),
|
|
43
|
+
"kk": import('/node_modules/flowbite-datepicker/js/i18n/locales/kk.js'),
|
|
44
|
+
"km": import('/node_modules/flowbite-datepicker/js/i18n/locales/km.js'),
|
|
45
|
+
"ko": import('/node_modules/flowbite-datepicker/js/i18n/locales/ko.js'),
|
|
46
|
+
"lt": import('/node_modules/flowbite-datepicker/js/i18n/locales/lt.js'),
|
|
47
|
+
"lv": import('/node_modules/flowbite-datepicker/js/i18n/locales/lv.js'),
|
|
48
|
+
"me": import('/node_modules/flowbite-datepicker/js/i18n/locales/me.js'),
|
|
49
|
+
"mk": import('/node_modules/flowbite-datepicker/js/i18n/locales/mk.js'),
|
|
50
|
+
"mn": import('/node_modules/flowbite-datepicker/js/i18n/locales/mn.js'),
|
|
51
|
+
"mr": import('/node_modules/flowbite-datepicker/js/i18n/locales/mr.js'),
|
|
52
|
+
"ms": import('/node_modules/flowbite-datepicker/js/i18n/locales/ms.js'),
|
|
53
|
+
"nl-BE": import('/node_modules/flowbite-datepicker/js/i18n/locales/nl-BE.js'),
|
|
54
|
+
"nl": import('/node_modules/flowbite-datepicker/js/i18n/locales/nl.js'),
|
|
55
|
+
"no": import('/node_modules/flowbite-datepicker/js/i18n/locales/no.js'),
|
|
56
|
+
"oc": import('/node_modules/flowbite-datepicker/js/i18n/locales/oc.js'),
|
|
57
|
+
"pl": import('/node_modules/flowbite-datepicker/js/i18n/locales/pl.js'),
|
|
58
|
+
"pt-BR": import('/node_modules/flowbite-datepicker/js/i18n/locales/pt-BR.js'),
|
|
59
|
+
"pt": import('/node_modules/flowbite-datepicker/js/i18n/locales/pt.js'),
|
|
60
|
+
"ro": import('/node_modules/flowbite-datepicker/js/i18n/locales/ro.js'),
|
|
61
|
+
"ru": import('/node_modules/flowbite-datepicker/js/i18n/locales/ru.js'),
|
|
62
|
+
"si": import('/node_modules/flowbite-datepicker/js/i18n/locales/si.js'),
|
|
63
|
+
"sk": import('/node_modules/flowbite-datepicker/js/i18n/locales/sk.js'),
|
|
64
|
+
"sl": import('/node_modules/flowbite-datepicker/js/i18n/locales/sl.js'),
|
|
65
|
+
"sq": import('/node_modules/flowbite-datepicker/js/i18n/locales/sq.js'),
|
|
66
|
+
"sr": import('/node_modules/flowbite-datepicker/js/i18n/locales/sr.js'),
|
|
67
|
+
"sr-latn": import('/node_modules/flowbite-datepicker/js/i18n/locales/sr-latn.js'),
|
|
68
|
+
"sv": import('/node_modules/flowbite-datepicker/js/i18n/locales/sv.js'),
|
|
69
|
+
"sw": import('/node_modules/flowbite-datepicker/js/i18n/locales/sw.js'),
|
|
70
|
+
"ta": import('/node_modules/flowbite-datepicker/js/i18n/locales/ta.js'),
|
|
71
|
+
"tg": import('/node_modules/flowbite-datepicker/js/i18n/locales/tg.js'),
|
|
72
|
+
"th": import('/node_modules/flowbite-datepicker/js/i18n/locales/th.js'),
|
|
73
|
+
"tk": import('/node_modules/flowbite-datepicker/js/i18n/locales/tk.js'),
|
|
74
|
+
"tr": import('/node_modules/flowbite-datepicker/js/i18n/locales/tr.js'),
|
|
75
|
+
"uk": import('/node_modules/flowbite-datepicker/js/i18n/locales/uk.js'),
|
|
76
|
+
"uz-cyrl": import('/node_modules/flowbite-datepicker/js/i18n/locales/uz-cyrl.js'),
|
|
77
|
+
"uz-latn": import('/node_modules/flowbite-datepicker/js/i18n/locales/uz-latn.js'),
|
|
78
|
+
"vi": import('/node_modules/flowbite-datepicker/js/i18n/locales/vi.js'),
|
|
79
|
+
"zh-CN": import('/node_modules/flowbite-datepicker/js/i18n/locales/zh-CN.js'),
|
|
80
|
+
"zh-TW": import('/node_modules/flowbite-datepicker/js/i18n/locales/zh-TW.js'),
|
|
81
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"af": import('dayjs/locale/af'),
|
|
3
|
+
"am": import('dayjs/locale/am'),
|
|
4
|
+
"ar-dz": import('dayjs/locale/ar-dz'),
|
|
5
|
+
"ar-iq": import('dayjs/locale/ar-iq'),
|
|
6
|
+
"ar-kw": import('dayjs/locale/ar-kw'),
|
|
7
|
+
"ar-ly": import('dayjs/locale/ar-ly'),
|
|
8
|
+
"ar-ma": import('dayjs/locale/ar-ma'),
|
|
9
|
+
"ar-sa": import('dayjs/locale/ar-sa'),
|
|
10
|
+
"ar-tn": import('dayjs/locale/ar-tn'),
|
|
11
|
+
"ar": import('dayjs/locale/ar'),
|
|
12
|
+
"az": import('dayjs/locale/az'),
|
|
13
|
+
"be": import('dayjs/locale/be'),
|
|
14
|
+
"bg": import('dayjs/locale/bg'),
|
|
15
|
+
"bi": import('dayjs/locale/bi'),
|
|
16
|
+
"bm": import('dayjs/locale/bm'),
|
|
17
|
+
"bn-bd": import('dayjs/locale/bn-bd'),
|
|
18
|
+
"bn": import('dayjs/locale/bn'),
|
|
19
|
+
"bo": import('dayjs/locale/bo'),
|
|
20
|
+
"br": import('dayjs/locale/br'),
|
|
21
|
+
"bs": import('dayjs/locale/bs'),
|
|
22
|
+
"ca": import('dayjs/locale/ca'),
|
|
23
|
+
"cs": import('dayjs/locale/cs'),
|
|
24
|
+
"cv": import('dayjs/locale/cv'),
|
|
25
|
+
"cy": import('dayjs/locale/cy'),
|
|
26
|
+
"da": import('dayjs/locale/da'),
|
|
27
|
+
"de-at": import('dayjs/locale/de-at'),
|
|
28
|
+
"de-ch": import('dayjs/locale/de-ch'),
|
|
29
|
+
"de": import('dayjs/locale/de'),
|
|
30
|
+
"dv": import('dayjs/locale/dv'),
|
|
31
|
+
"el": import('dayjs/locale/el'),
|
|
32
|
+
"en-au": import('dayjs/locale/en-au'),
|
|
33
|
+
"en-ca": import('dayjs/locale/en-ca'),
|
|
34
|
+
"en-gb": import('dayjs/locale/en-gb'),
|
|
35
|
+
"en-ie": import('dayjs/locale/en-ie'),
|
|
36
|
+
"en-il": import('dayjs/locale/en-il'),
|
|
37
|
+
"en-in": import('dayjs/locale/en-in'),
|
|
38
|
+
"en-nz": import('dayjs/locale/en-nz'),
|
|
39
|
+
"en-sg": import('dayjs/locale/en-sg'),
|
|
40
|
+
"en-tt": import('dayjs/locale/en-tt'),
|
|
41
|
+
"en": import('dayjs/locale/en'),
|
|
42
|
+
"eo": import('dayjs/locale/eo'),
|
|
43
|
+
"es-do": import('dayjs/locale/es-do'),
|
|
44
|
+
"es-mx": import('dayjs/locale/es-mx'),
|
|
45
|
+
"es-pr": import('dayjs/locale/es-pr'),
|
|
46
|
+
"es-us": import('dayjs/locale/es-us'),
|
|
47
|
+
"es": import('dayjs/locale/es'),
|
|
48
|
+
"et": import('dayjs/locale/et'),
|
|
49
|
+
"eu": import('dayjs/locale/eu'),
|
|
50
|
+
"fa": import('dayjs/locale/fa'),
|
|
51
|
+
"fi": import('dayjs/locale/fi'),
|
|
52
|
+
"fo": import('dayjs/locale/fo'),
|
|
53
|
+
"fr-ca": import('dayjs/locale/fr-ca'),
|
|
54
|
+
"fr-ch": import('dayjs/locale/fr-ch'),
|
|
55
|
+
"fr": import('dayjs/locale/fr'),
|
|
56
|
+
"fy": import('dayjs/locale/fy'),
|
|
57
|
+
"ga": import('dayjs/locale/ga'),
|
|
58
|
+
"gd": import('dayjs/locale/gd'),
|
|
59
|
+
"gl": import('dayjs/locale/gl'),
|
|
60
|
+
"gom-latn": import('dayjs/locale/gom-latn'),
|
|
61
|
+
"gu": import('dayjs/locale/gu'),
|
|
62
|
+
"he": import('dayjs/locale/he'),
|
|
63
|
+
"hi": import('dayjs/locale/hi'),
|
|
64
|
+
"hr": import('dayjs/locale/hr'),
|
|
65
|
+
"ht": import('dayjs/locale/ht'),
|
|
66
|
+
"hu": import('dayjs/locale/hu'),
|
|
67
|
+
"hy-am": import('dayjs/locale/hy-am'),
|
|
68
|
+
"id": import('dayjs/locale/id'),
|
|
69
|
+
"is": import('dayjs/locale/is'),
|
|
70
|
+
"it-ch": import('dayjs/locale/it-ch'),
|
|
71
|
+
"it": import('dayjs/locale/it'),
|
|
72
|
+
"ja": import('dayjs/locale/ja'),
|
|
73
|
+
"jv": import('dayjs/locale/jv'),
|
|
74
|
+
"ka": import('dayjs/locale/ka'),
|
|
75
|
+
"kk": import('dayjs/locale/kk'),
|
|
76
|
+
"km": import('dayjs/locale/km'),
|
|
77
|
+
"kn": import('dayjs/locale/kn'),
|
|
78
|
+
"ko": import('dayjs/locale/ko'),
|
|
79
|
+
"ku": import('dayjs/locale/ku'),
|
|
80
|
+
"ky": import('dayjs/locale/ky'),
|
|
81
|
+
"lb": import('dayjs/locale/lb'),
|
|
82
|
+
"lo": import('dayjs/locale/lo'),
|
|
83
|
+
"lt": import('dayjs/locale/lt'),
|
|
84
|
+
"lv": import('dayjs/locale/lv'),
|
|
85
|
+
"me": import('dayjs/locale/me'),
|
|
86
|
+
"mi": import('dayjs/locale/mi'),
|
|
87
|
+
"mk": import('dayjs/locale/mk'),
|
|
88
|
+
"ml": import('dayjs/locale/ml'),
|
|
89
|
+
"mn": import('dayjs/locale/mn'),
|
|
90
|
+
"mr": import('dayjs/locale/mr'),
|
|
91
|
+
"ms-my": import('dayjs/locale/ms-my'),
|
|
92
|
+
"ms": import('dayjs/locale/ms'),
|
|
93
|
+
"mt": import('dayjs/locale/mt'),
|
|
94
|
+
"my": import('dayjs/locale/my'),
|
|
95
|
+
"nb": import('dayjs/locale/nb'),
|
|
96
|
+
"ne": import('dayjs/locale/ne'),
|
|
97
|
+
"nl-be": import('dayjs/locale/nl-be'),
|
|
98
|
+
"nl": import('dayjs/locale/nl'),
|
|
99
|
+
"nn": import('dayjs/locale/nn'),
|
|
100
|
+
"oc-lnc": import('dayjs/locale/oc-lnc'),
|
|
101
|
+
"pa-in": import('dayjs/locale/pa-in'),
|
|
102
|
+
"pl": import('dayjs/locale/pl'),
|
|
103
|
+
"pt-br": import('dayjs/locale/pt-br'),
|
|
104
|
+
"pt": import('dayjs/locale/pt'),
|
|
105
|
+
"rn": import('dayjs/locale/rn'),
|
|
106
|
+
"ro": import('dayjs/locale/ro'),
|
|
107
|
+
"ru": import('dayjs/locale/ru'),
|
|
108
|
+
"rw": import('dayjs/locale/rw'),
|
|
109
|
+
"sd": import('dayjs/locale/sd'),
|
|
110
|
+
"se": import('dayjs/locale/se'),
|
|
111
|
+
"si": import('dayjs/locale/si'),
|
|
112
|
+
"sk": import('dayjs/locale/sk'),
|
|
113
|
+
"sl": import('dayjs/locale/sl'),
|
|
114
|
+
"sq": import('dayjs/locale/sq'),
|
|
115
|
+
"sr-cyrl": import('dayjs/locale/sr-cyrl'),
|
|
116
|
+
"sr": import('dayjs/locale/sr'),
|
|
117
|
+
"ss": import('dayjs/locale/ss'),
|
|
118
|
+
"sv-fi": import('dayjs/locale/sv-fi'),
|
|
119
|
+
"sv": import('dayjs/locale/sv'),
|
|
120
|
+
"sw": import('dayjs/locale/sw'),
|
|
121
|
+
"ta": import('dayjs/locale/ta'),
|
|
122
|
+
"te": import('dayjs/locale/te'),
|
|
123
|
+
"tet": import('dayjs/locale/tet'),
|
|
124
|
+
"tg": import('dayjs/locale/tg'),
|
|
125
|
+
"th": import('dayjs/locale/th'),
|
|
126
|
+
"tk": import('dayjs/locale/tk'),
|
|
127
|
+
"tl-ph": import('dayjs/locale/tl-ph'),
|
|
128
|
+
"tlh": import('dayjs/locale/tlh'),
|
|
129
|
+
"tr": import('dayjs/locale/tr'),
|
|
130
|
+
"tzl": import('dayjs/locale/tzl'),
|
|
131
|
+
"tzm-latn": import('dayjs/locale/tzm-latn'),
|
|
132
|
+
"tzm": import('dayjs/locale/tzm'),
|
|
133
|
+
"ug-cn": import('dayjs/locale/ug-cn'),
|
|
134
|
+
"uk": import('dayjs/locale/uk'),
|
|
135
|
+
"ur": import('dayjs/locale/ur'),
|
|
136
|
+
"uz-latn": import('dayjs/locale/uz-latn'),
|
|
137
|
+
"uz": import('dayjs/locale/uz'),
|
|
138
|
+
"vi": import('dayjs/locale/vi'),
|
|
139
|
+
"x-pseudo": import('dayjs/locale/x-pseudo'),
|
|
140
|
+
"yo": import('dayjs/locale/yo'),
|
|
141
|
+
"zh-cn": import('dayjs/locale/zh-cn'),
|
|
142
|
+
"zh-hk": import('dayjs/locale/zh-hk'),
|
|
143
|
+
"zh-tw": import('dayjs/locale/zh-tw'),
|
|
144
|
+
"zh": import('dayjs/locale/zh'),
|
|
145
|
+
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { callAdminForthApi } from '@/utils';
|
|
3
|
+
import dayjsLocales from './dayjsLocales';
|
|
4
|
+
import datepickerLocales from './datepickerLocales';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import Datepicker from "flowbite-datepicker/Datepicker";
|
|
3
7
|
|
|
4
8
|
|
|
5
9
|
const messagesCache: Record<
|
|
@@ -33,6 +37,22 @@ export async function setLang({ setLocaleMessage, locale }: any, pluginInstanceI
|
|
|
33
37
|
messages: messages
|
|
34
38
|
};
|
|
35
39
|
}
|
|
40
|
+
|
|
41
|
+
// set dayjs locale
|
|
42
|
+
try {
|
|
43
|
+
await dayjsLocales[langIso];
|
|
44
|
+
dayjs.locale(langIso);
|
|
45
|
+
} catch {
|
|
46
|
+
dayjs.locale('en');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// set datepicker locale
|
|
50
|
+
if (datepickerLocales[langIso]) {
|
|
51
|
+
Datepicker.locales[langIso] = (await datepickerLocales[langIso]).default[langIso];
|
|
52
|
+
} else if (Object.keys(datepickerLocales).some((l) => l.startsWith(`${langIso}-`)) && langIso !== 'en') {
|
|
53
|
+
const lang = Object.keys(datepickerLocales).find((l) => l.startsWith(`${langIso}-`));
|
|
54
|
+
Datepicker.locales[langIso] = (await datepickerLocales[lang]).default[lang];
|
|
55
|
+
}
|
|
36
56
|
|
|
37
57
|
// set locale and locale message
|
|
38
58
|
setLocaleMessage(langIso, messagesCache[langIso].messages);
|
package/dist/index.js
CHANGED
|
@@ -128,6 +128,7 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
128
128
|
throw new Error(`Invalid language code ${lang}, please define valid ISO 639-1 language code (2 lowercase letters)`);
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
|
+
this.externalAppOnly = this.options.externalAppOnly === true;
|
|
131
132
|
// find primary key field
|
|
132
133
|
this.primaryKeyFieldName = (_a = resourceConfig.columns.find(c => c.primaryKey)) === null || _a === void 0 ? void 0 : _a.name;
|
|
133
134
|
if (!this.primaryKeyFieldName) {
|
|
@@ -236,18 +237,20 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
236
237
|
}))
|
|
237
238
|
};
|
|
238
239
|
// add underLogin component
|
|
239
|
-
(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
240
|
+
if (!this.externalAppOnly) {
|
|
241
|
+
(adminforth.config.customization.loginPageInjections.underInputs).push({
|
|
242
|
+
file: this.componentPath('LanguageUnderLogin.vue'),
|
|
243
|
+
meta: compMeta
|
|
244
|
+
});
|
|
245
|
+
(adminforth.config.customization.globalInjections.userMenu).push({
|
|
246
|
+
file: this.componentPath('LanguageInUserMenu.vue'),
|
|
247
|
+
meta: compMeta
|
|
248
|
+
});
|
|
249
|
+
adminforth.config.customization.globalInjections.everyPageBottom.push({
|
|
250
|
+
file: this.componentPath('LanguageEveryPageLoader.vue'),
|
|
251
|
+
meta: compMeta
|
|
252
|
+
});
|
|
253
|
+
}
|
|
251
254
|
// disable create allowedActions for translations
|
|
252
255
|
resourceConfig.options.allowedActions.create = false;
|
|
253
256
|
// add hook to validate user did not screw up with template params
|
|
@@ -618,7 +621,9 @@ ${JSON.stringify(strings.reduce((acc, s) => {
|
|
|
618
621
|
throw new Error(`Field ${this.options.categoryFieldName} should be of type string in resource ${resourceConfig.resourceId}, but it is ${categoryColumn.type}`);
|
|
619
622
|
}
|
|
620
623
|
// in this plugin we will use plugin to fill the database with missing language messages
|
|
621
|
-
this.
|
|
624
|
+
if (!this.externalAppOnly) {
|
|
625
|
+
this.tryProcessAndWatch(adminforth);
|
|
626
|
+
}
|
|
622
627
|
adminforth.tr = (msg, category, lang, params, pluralizationNumber) => __awaiter(this, void 0, void 0, function* () {
|
|
623
628
|
if (!msg) {
|
|
624
629
|
return msg;
|
package/index.ts
CHANGED
|
@@ -94,6 +94,8 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
94
94
|
|
|
95
95
|
adminforth: IAdminForth;
|
|
96
96
|
|
|
97
|
+
externalAppOnly: boolean;
|
|
98
|
+
|
|
97
99
|
// sorted by name list of all supported languages, without en e.g. 'al|ro|uk'
|
|
98
100
|
fullCompleatedFieldValue: string;
|
|
99
101
|
|
|
@@ -140,7 +142,8 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
140
142
|
throw new Error(`Invalid language code ${lang}, please define valid ISO 639-1 language code (2 lowercase letters)`);
|
|
141
143
|
}
|
|
142
144
|
});
|
|
143
|
-
|
|
145
|
+
|
|
146
|
+
this.externalAppOnly = this.options.externalAppOnly === true;
|
|
144
147
|
|
|
145
148
|
// find primary key field
|
|
146
149
|
this.primaryKeyFieldName = resourceConfig.columns.find(c => c.primaryKey)?.name;
|
|
@@ -265,20 +268,22 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
265
268
|
))
|
|
266
269
|
};
|
|
267
270
|
// add underLogin component
|
|
268
|
-
(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
if (!this.externalAppOnly) {
|
|
272
|
+
(adminforth.config.customization.loginPageInjections.underInputs).push({
|
|
273
|
+
file: this.componentPath('LanguageUnderLogin.vue'),
|
|
274
|
+
meta: compMeta
|
|
275
|
+
});
|
|
272
276
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
(adminforth.config.customization.globalInjections.userMenu).push({
|
|
278
|
+
file: this.componentPath('LanguageInUserMenu.vue'),
|
|
279
|
+
meta: compMeta
|
|
280
|
+
});
|
|
277
281
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
+
adminforth.config.customization.globalInjections.everyPageBottom.push({
|
|
283
|
+
file: this.componentPath('LanguageEveryPageLoader.vue'),
|
|
284
|
+
meta: compMeta
|
|
285
|
+
});
|
|
286
|
+
}
|
|
282
287
|
|
|
283
288
|
// disable create allowedActions for translations
|
|
284
289
|
resourceConfig.options.allowedActions.create = false;
|
|
@@ -735,7 +740,9 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
|
|
|
735
740
|
}
|
|
736
741
|
|
|
737
742
|
// in this plugin we will use plugin to fill the database with missing language messages
|
|
738
|
-
this.
|
|
743
|
+
if (!this.externalAppOnly) {
|
|
744
|
+
this.tryProcessAndWatch(adminforth);
|
|
745
|
+
}
|
|
739
746
|
|
|
740
747
|
adminforth.tr = async (msg: string | null | undefined, category: string, lang: string, params, pluralizationNumber: number): Promise<string> => {
|
|
741
748
|
if (!msg) {
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -36,4 +36,10 @@ export interface PluginOptions {
|
|
|
36
36
|
* semiautomatically (creates a bulk action for generating translations)
|
|
37
37
|
*/
|
|
38
38
|
completeAdapter?: CompletionAdapter
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optionally translation plugin available to translate only external applications (like SEO-facing or user-facing services),
|
|
42
|
+
* not AdminForth applications
|
|
43
|
+
*/
|
|
44
|
+
externalAppOnly?: boolean;
|
|
39
45
|
}
|