@kingteza/crud-component 1.14.5 → 1.14.7
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/locale/index.cjs.js +1 -1
- package/dist/locale/index.es.js +28 -34
- package/package.json +1 -1
package/dist/locale/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),A=require("./translations/en.cjs.js"),r=require("i18next"),o=require("react-i18next"),c={en:{[a.TRANSLATION_NAMESPACE]:A}};exports.i18nInstance=r;const S=(n={})=>{const{translations:t=c,language:e="en",i18nInstance:i}=n,s=i||r;return exports.i18nInstance=s,s.isInitialized?Object.entries(t).forEach(([l,T])=>{Object.entries(T).forEach(([I,N])=>{s.addResourceBundle(l,I,N,!0,!0)})}):s.use(o.initReactI18next).init({resources:t,lng:e,fallbackLng:"en",ns:a.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),r},d=(n,t,e)=>{(e||r).addResourceBundle(n,a.TRANSLATION_NAMESPACE,t,!0,!0)},E=n=>(console.log("i18nInstance",exports.i18nInstance,n),o.useTranslation(a.TRANSLATION_NAMESPACE,{...n,i18n:exports.i18nInstance})),L=n=>(console.log("i18nInstance",exports.i18nInstance,n),o.useTranslation(void 0,{...n,i18n:exports.i18nInstance})),u=(n,t)=>{var e;return(e=exports.i18nInstance)==null?void 0:e.t(n,{ns:a.TRANSLATION_NAMESPACE,...t})},O=(n,t,e)=>{var s;const i=u(n,t);return i&&n&&i!==n?i:e||((s=exports.i18nInstance)==null?void 0:s.t(n,{ns:void 0,...t}))};exports.defaultTranslations=c;exports.setupI18n=S;exports.t=u;exports.tWithOrWithoutNS=O;exports.updateTranslations=d;exports.useTranslationLib=E;exports.useTranslationLibNoNS=L;
|
package/dist/locale/index.es.js
CHANGED
|
@@ -1,63 +1,57 @@
|
|
|
1
|
-
import { TRANSLATION_NAMESPACE as
|
|
2
|
-
import
|
|
1
|
+
import { TRANSLATION_NAMESPACE as o } from "./hooks/translation-constants.es.js";
|
|
2
|
+
import T from "./translations/en.es.js";
|
|
3
3
|
import a from "i18next";
|
|
4
|
-
import { initReactI18next as
|
|
5
|
-
const
|
|
4
|
+
import { initReactI18next as m, useTranslation as u } from "react-i18next";
|
|
5
|
+
const g = {
|
|
6
6
|
en: {
|
|
7
|
-
[
|
|
7
|
+
[o]: T
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
let e = a;
|
|
11
|
-
const
|
|
11
|
+
const A = (n = {}) => {
|
|
12
12
|
const {
|
|
13
|
-
translations: t =
|
|
14
|
-
language:
|
|
13
|
+
translations: t = g,
|
|
14
|
+
language: r = "en",
|
|
15
15
|
i18nInstance: s
|
|
16
|
-
} = n,
|
|
17
|
-
return e =
|
|
18
|
-
Object.entries(
|
|
19
|
-
|
|
16
|
+
} = n, i = s || a;
|
|
17
|
+
return e = i, i.isInitialized ? Object.entries(t).forEach(([c, l]) => {
|
|
18
|
+
Object.entries(l).forEach(([d, f]) => {
|
|
19
|
+
i.addResourceBundle(c, d, f, !0, !0);
|
|
20
20
|
});
|
|
21
|
-
}) :
|
|
21
|
+
}) : i.use(m).init({
|
|
22
22
|
resources: t,
|
|
23
|
-
lng:
|
|
23
|
+
lng: r,
|
|
24
24
|
fallbackLng: "en",
|
|
25
|
-
ns:
|
|
25
|
+
ns: o,
|
|
26
26
|
interpolation: {
|
|
27
27
|
escapeValue: !1
|
|
28
28
|
}
|
|
29
29
|
}), a;
|
|
30
|
-
},
|
|
31
|
-
(
|
|
30
|
+
}, E = (n, t, r) => {
|
|
31
|
+
(r || a).addResourceBundle(
|
|
32
32
|
n,
|
|
33
|
-
|
|
33
|
+
o,
|
|
34
34
|
t,
|
|
35
35
|
!0,
|
|
36
36
|
!0
|
|
37
37
|
);
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
lng: "en",
|
|
41
|
-
fallbackLng: "en",
|
|
42
|
-
ns: r,
|
|
43
|
-
interpolation: { escapeValue: !1 }
|
|
44
|
-
}), l(r, { ...n, i18n: e })), O = (n) => l(void 0, { ...n, i18n: e }), g = (n, t) => e == null ? void 0 : e.t(n, {
|
|
45
|
-
ns: r,
|
|
38
|
+
}, L = (n) => (console.log("i18nInstance", e, n), u(o, { ...n, i18n: e })), O = (n) => (console.log("i18nInstance", e, n), u(void 0, { ...n, i18n: e })), p = (n, t) => e == null ? void 0 : e.t(n, {
|
|
39
|
+
ns: o,
|
|
46
40
|
...t
|
|
47
|
-
}), R = (n, t,
|
|
48
|
-
const s =
|
|
49
|
-
return s && n && s !== n ? s :
|
|
41
|
+
}), R = (n, t, r) => {
|
|
42
|
+
const s = p(n, t);
|
|
43
|
+
return s && n && s !== n ? s : r || (e == null ? void 0 : e.t(n, {
|
|
50
44
|
ns: void 0,
|
|
51
45
|
...t
|
|
52
46
|
}));
|
|
53
47
|
};
|
|
54
48
|
export {
|
|
55
|
-
|
|
49
|
+
g as defaultTranslations,
|
|
56
50
|
e as i18nInstance,
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
A as setupI18n,
|
|
52
|
+
p as t,
|
|
59
53
|
R as tWithOrWithoutNS,
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
E as updateTranslations,
|
|
55
|
+
L as useTranslationLib,
|
|
62
56
|
O as useTranslationLibNoNS
|
|
63
57
|
};
|