@alfadocs/ui-kit 0.41.0 → 0.41.2
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/dist/agent-catalog.json +1 -1
- package/dist/i18n/config.js +39 -24
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/agent-catalog.json
CHANGED
package/dist/i18n/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "i18next";
|
|
2
2
|
import { default as v } from "i18next";
|
|
3
|
-
import { initReactI18next as
|
|
4
|
-
import { enUi as
|
|
3
|
+
import { initReactI18next as p } from "react-i18next";
|
|
4
|
+
import { enUi as o } from "./locales/en.js";
|
|
5
5
|
const c = [
|
|
6
6
|
"en",
|
|
7
7
|
"it",
|
|
@@ -22,18 +22,18 @@ const c = [
|
|
|
22
22
|
"zh",
|
|
23
23
|
"hi"
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
|
|
25
|
+
function U(e, t) {
|
|
26
|
+
i.addResourceBundle(
|
|
27
27
|
e,
|
|
28
28
|
"ui",
|
|
29
|
-
|
|
29
|
+
t,
|
|
30
30
|
/* deep */
|
|
31
31
|
!0,
|
|
32
32
|
/* overwrite */
|
|
33
33
|
!1
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const m = {}, r = typeof import.meta < "u" && typeof m < "u" && !1, s = {
|
|
37
37
|
it: () => import("./locales/it.js").then((e) => e.itUi),
|
|
38
38
|
de: () => import("./locales/de.js").then((e) => e.deUi),
|
|
39
39
|
ar: () => import("./locales/ar.js").then((e) => e.arUi),
|
|
@@ -52,11 +52,25 @@ const l = {}, r = typeof import.meta < "u" && typeof l < "u" && !1, o = {
|
|
|
52
52
|
zh: () => import("./locales/zh.js").then((e) => e.zhUi),
|
|
53
53
|
hi: () => import("./locales/hi.js").then((e) => e.hiUi)
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
function u() {
|
|
56
|
+
i.addResourceBundle(
|
|
57
|
+
"en",
|
|
58
|
+
"ui",
|
|
59
|
+
o,
|
|
60
|
+
/* deep */
|
|
61
|
+
!0,
|
|
62
|
+
/* overwrite */
|
|
63
|
+
!1
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
i.isInitialized ? u() : i.use(p).init({
|
|
56
67
|
lng: "en",
|
|
57
68
|
fallbackLng: "en",
|
|
58
69
|
ns: ["ui"],
|
|
59
70
|
defaultNS: "ui",
|
|
71
|
+
// The kit bundles only `en` eagerly and lazy-loads the rest, so the store
|
|
72
|
+
// is partially bundled — let a later consumer `init()` / backend coexist.
|
|
73
|
+
partialBundledLanguages: !0,
|
|
60
74
|
debug: r,
|
|
61
75
|
saveMissing: r,
|
|
62
76
|
missingKeyHandler: void 0,
|
|
@@ -67,39 +81,40 @@ t.use(u).init({
|
|
|
67
81
|
// changeLanguage wrapper below (or the explicit `loadLocale` /
|
|
68
82
|
// `setLocale` / `loadAllLocales` helpers).
|
|
69
83
|
resources: {
|
|
70
|
-
en: { ui:
|
|
84
|
+
en: { ui: o }
|
|
71
85
|
}
|
|
72
86
|
});
|
|
87
|
+
i.on("initialized", u);
|
|
73
88
|
async function n(e) {
|
|
74
|
-
if (e === "en" ||
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
89
|
+
if (e === "en" || i.hasResourceBundle(e, "ui")) return;
|
|
90
|
+
const t = s[e];
|
|
91
|
+
if (!t)
|
|
77
92
|
return;
|
|
78
|
-
const
|
|
79
|
-
|
|
93
|
+
const l = await t();
|
|
94
|
+
i.addResourceBundle(
|
|
80
95
|
e,
|
|
81
96
|
"ui",
|
|
82
|
-
|
|
97
|
+
l,
|
|
83
98
|
/* deep */
|
|
84
99
|
!0,
|
|
85
100
|
/* overwrite */
|
|
86
101
|
!1
|
|
87
102
|
);
|
|
88
103
|
}
|
|
89
|
-
async function
|
|
90
|
-
await n(e), await
|
|
104
|
+
async function g(e) {
|
|
105
|
+
await n(e), await i.changeLanguage(e);
|
|
91
106
|
}
|
|
92
|
-
async function
|
|
93
|
-
await Promise.all(Object.keys(
|
|
107
|
+
async function L() {
|
|
108
|
+
await Promise.all(Object.keys(s).map((e) => n(e)));
|
|
94
109
|
}
|
|
95
|
-
const a =
|
|
96
|
-
|
|
110
|
+
const a = i.changeLanguage.bind(i);
|
|
111
|
+
i.changeLanguage = ((e, t) => e ? n(e).then(() => a(e, t)) : a(e, t));
|
|
97
112
|
export {
|
|
98
113
|
c as LOCALES_WITH_BUNDLES,
|
|
99
114
|
v as default,
|
|
100
|
-
|
|
115
|
+
L as loadAllLocales,
|
|
101
116
|
n as loadLocale,
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
U as registerUiBundle,
|
|
118
|
+
g as setLocale
|
|
104
119
|
};
|
|
105
120
|
//# sourceMappingURL=config.js.map
|