@deriv-com/translations 1.3.11 → 1.3.12
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/components/localize.d.ts +0 -1
- package/dist/components/localize.js +125 -121
- package/dist/{crc32-DnIYX8GT.js → crc32-BeCcwohL.js} +117 -113
- package/dist/hooks/use-translations.js +4 -4
- package/dist/{i18nInstance-D20fwFYr.js → i18nInstance-D3STmr24.js} +2 -2
- package/dist/{jsx-runtime-BuVcKMXM.js → jsx-runtime-oIKL5WiM.js} +170 -171
- package/dist/provider/translation-provider.d.ts +0 -1
- package/dist/provider/translation-provider.js +2 -2
- package/dist/{useTranslation-D9WrAGyQ.js → useTranslation-CZfO55Z-.js} +4 -4
- package/dist/utils/initialize-i18n.d.ts +0 -1
- package/dist/utils/initialize-i18n.js +2 -2
- package/dist/utils/lang-utils.d.ts +0 -1
- package/dist/utils/lang-utils.js +1 -1
- package/dist/utils/localize.js +5 -5
- package/dist/utils/otasdk.d.ts +0 -1
- package/dist/utils/otasdk.js +13 -16
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ge = {
|
|
2
2
|
type: "logger",
|
|
3
3
|
log(i) {
|
|
4
4
|
this.output("log", i);
|
|
@@ -20,7 +20,7 @@ class M {
|
|
|
20
20
|
}
|
|
21
21
|
init(e) {
|
|
22
22
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
23
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
23
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || ge, this.options = t, this.debug = t.debug;
|
|
24
24
|
}
|
|
25
25
|
log() {
|
|
26
26
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
@@ -91,15 +91,15 @@ function D() {
|
|
|
91
91
|
});
|
|
92
92
|
return t.resolve = i, t.reject = e, t;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function _(i) {
|
|
95
95
|
return i == null ? "" : "" + i;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function he(i, e, t) {
|
|
98
98
|
i.forEach((n) => {
|
|
99
99
|
e[n] && (t[n] = e[n]);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Q(i, e, t) {
|
|
103
103
|
function n(a) {
|
|
104
104
|
return a && a.indexOf("###") > -1 ? a.replace(/###/g, ".") : a;
|
|
105
105
|
}
|
|
@@ -117,41 +117,41 @@ function G(i, e, t) {
|
|
|
117
117
|
k: n(r.shift())
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function ee(i, e, t) {
|
|
121
121
|
const {
|
|
122
122
|
obj: n,
|
|
123
123
|
k: s
|
|
124
|
-
} =
|
|
124
|
+
} = Q(i, e, Object);
|
|
125
125
|
n[s] = t;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function ce(i, e, t, n) {
|
|
128
128
|
const {
|
|
129
129
|
obj: s,
|
|
130
130
|
k: r
|
|
131
|
-
} =
|
|
131
|
+
} = Q(i, e, Object);
|
|
132
132
|
s[r] = s[r] || [], s[r].push(t);
|
|
133
133
|
}
|
|
134
134
|
function H(i, e) {
|
|
135
135
|
const {
|
|
136
136
|
obj: t,
|
|
137
137
|
k: n
|
|
138
|
-
} =
|
|
138
|
+
} = Q(i, e);
|
|
139
139
|
if (t)
|
|
140
140
|
return t[n];
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function de(i, e, t) {
|
|
143
143
|
const n = H(i, t);
|
|
144
144
|
return n !== void 0 ? n : H(e, t);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function ue(i, e, t) {
|
|
147
147
|
for (const n in e)
|
|
148
|
-
n !== "__proto__" && n !== "constructor" && (n in i ? typeof i[n] == "string" || i[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? t && (i[n] = e[n]) :
|
|
148
|
+
n !== "__proto__" && n !== "constructor" && (n in i ? typeof i[n] == "string" || i[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? t && (i[n] = e[n]) : ue(i[n], e[n], t) : i[n] = e[n]);
|
|
149
149
|
return i;
|
|
150
150
|
}
|
|
151
151
|
function I(i) {
|
|
152
152
|
return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
153
153
|
}
|
|
154
|
-
var
|
|
154
|
+
var pe = {
|
|
155
155
|
"&": "&",
|
|
156
156
|
"<": "<",
|
|
157
157
|
">": ">",
|
|
@@ -159,13 +159,13 @@ var ce = {
|
|
|
159
159
|
"'": "'",
|
|
160
160
|
"/": "/"
|
|
161
161
|
};
|
|
162
|
-
function
|
|
163
|
-
return typeof i == "string" ? i.replace(/[&<>"'\/]/g, (e) =>
|
|
162
|
+
function me(i) {
|
|
163
|
+
return typeof i == "string" ? i.replace(/[&<>"'\/]/g, (e) => pe[e]) : i;
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
function
|
|
165
|
+
const ye = [" ", ",", "?", "!", ";"];
|
|
166
|
+
function be(i, e, t) {
|
|
167
167
|
e = e || "", t = t || "";
|
|
168
|
-
const n =
|
|
168
|
+
const n = ye.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
169
169
|
if (n.length === 0) return !0;
|
|
170
170
|
const s = new RegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
171
171
|
let r = !s.test(i);
|
|
@@ -204,7 +204,7 @@ function J(i, e) {
|
|
|
204
204
|
function z(i) {
|
|
205
205
|
return i && i.indexOf("_") > 0 ? i.replace("_", "-") : i;
|
|
206
206
|
}
|
|
207
|
-
class
|
|
207
|
+
class te extends Y {
|
|
208
208
|
constructor(e) {
|
|
209
209
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
210
210
|
ns: ["translation"],
|
|
@@ -233,7 +233,7 @@ class ee extends Y {
|
|
|
233
233
|
};
|
|
234
234
|
const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
|
|
235
235
|
let l = [e, t];
|
|
236
|
-
n && (l = l.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (l = e.split("."), s = t, t = l[1]), this.addNamespaces(t),
|
|
236
|
+
n && (l = l.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (l = e.split("."), s = t, t = l[1]), this.addNamespaces(t), ee(this.data, l, s), r.silent || this.emit("added", e, t, n, s);
|
|
237
237
|
}
|
|
238
238
|
addResources(e, t, n) {
|
|
239
239
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
@@ -251,10 +251,10 @@ class ee extends Y {
|
|
|
251
251
|
}, l = [e, t];
|
|
252
252
|
e.indexOf(".") > -1 && (l = e.split("."), s = n, n = t, t = l[1]), this.addNamespaces(t);
|
|
253
253
|
let o = H(this.data, l) || {};
|
|
254
|
-
s ?
|
|
254
|
+
s ? ue(o, n, r) : o = {
|
|
255
255
|
...o,
|
|
256
256
|
...n
|
|
257
|
-
},
|
|
257
|
+
}, ee(this.data, l, o), a.silent || this.emit("added", e, t, n);
|
|
258
258
|
}
|
|
259
259
|
removeResourceBundle(e, t) {
|
|
260
260
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -278,7 +278,7 @@ class ee extends Y {
|
|
|
278
278
|
return this.data;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var fe = {
|
|
282
282
|
processors: {},
|
|
283
283
|
addPostProcessor(i) {
|
|
284
284
|
this.processors[i.name] = i;
|
|
@@ -289,11 +289,11 @@ var le = {
|
|
|
289
289
|
}), e;
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
-
const
|
|
292
|
+
const ne = {};
|
|
293
293
|
class W extends Y {
|
|
294
294
|
constructor(e) {
|
|
295
295
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
296
|
-
super(),
|
|
296
|
+
super(), he(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = k.create("translator");
|
|
297
297
|
}
|
|
298
298
|
changeLanguage(e) {
|
|
299
299
|
e && (this.language = e);
|
|
@@ -312,7 +312,7 @@ class W extends Y {
|
|
|
312
312
|
n === void 0 && (n = ":");
|
|
313
313
|
const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
314
314
|
let r = t.ns || this.options.defaultNS || [];
|
|
315
|
-
const a = n && e.indexOf(n) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
315
|
+
const a = n && e.indexOf(n) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !be(e, n, s);
|
|
316
316
|
if (a && !l) {
|
|
317
317
|
const o = e.match(this.interpolator.nestingRegexp);
|
|
318
318
|
if (o && o.length > 0)
|
|
@@ -406,15 +406,15 @@ class W extends Y {
|
|
|
406
406
|
for (let F = 0; F < K.length; F++)
|
|
407
407
|
j.push(K[F]);
|
|
408
408
|
else this.options.saveMissingTo === "all" ? j = this.languageUtils.toResolveHierarchy(t.lng || this.language) : j.push(t.lng || this.language);
|
|
409
|
-
const
|
|
409
|
+
const q = (F, E, X) => {
|
|
410
410
|
const Z = w && X !== u ? X : b;
|
|
411
411
|
this.options.missingKeyHandler ? this.options.missingKeyHandler(F, o, E, Z, S, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(F, o, E, Z, S, t), this.emit("missingKey", F, o, E, u);
|
|
412
412
|
};
|
|
413
413
|
this.options.saveMissing && (this.options.saveMissingPlurals && $ ? j.forEach((F) => {
|
|
414
414
|
this.pluralResolver.getSuffixes(F, t).forEach((E) => {
|
|
415
|
-
|
|
415
|
+
q([F], a + E, t[`defaultValue${E}`] || d);
|
|
416
416
|
});
|
|
417
|
-
}) :
|
|
417
|
+
}) : q(j, a, d));
|
|
418
418
|
}
|
|
419
419
|
u = this.extendTranslation(u, e, t, c, n), R && u === a && this.options.appendNamespaceToMissingKey && (u = `${o}:${a}`), (R || L) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, L ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
|
|
420
420
|
}
|
|
@@ -458,7 +458,7 @@ class W extends Y {
|
|
|
458
458
|
}, n)), n.interpolation && this.interpolator.reset();
|
|
459
459
|
}
|
|
460
460
|
const l = n.postProcess || this.options.postProcess, o = typeof l == "string" ? [l] : l;
|
|
461
|
-
return e != null && o && o.length && n.applyPostProcessor !== !1 && (e =
|
|
461
|
+
return e != null && o && o.length && n.applyPostProcessor !== !1 && (e = fe.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
462
462
|
i18nResolved: {
|
|
463
463
|
...s,
|
|
464
464
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -476,7 +476,7 @@ class W extends Y {
|
|
|
476
476
|
this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
|
|
477
477
|
const u = t.count !== void 0 && typeof t.count != "string", m = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), p = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", x = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
478
478
|
c.forEach((v) => {
|
|
479
|
-
this.isValidLookup(n) || (l = v, !
|
|
479
|
+
this.isValidLookup(n) || (l = v, !ne[`${x[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(l) && (ne[`${x[0]}-${v}`] = !0, this.logger.warn(`key "${s}" for languages "${x.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), x.forEach((P) => {
|
|
480
480
|
if (this.isValidLookup(n)) return;
|
|
481
481
|
a = P;
|
|
482
482
|
const O = [g];
|
|
@@ -538,7 +538,7 @@ class W extends Y {
|
|
|
538
538
|
function B(i) {
|
|
539
539
|
return i.charAt(0).toUpperCase() + i.slice(1);
|
|
540
540
|
}
|
|
541
|
-
class
|
|
541
|
+
class se {
|
|
542
542
|
constructor(e) {
|
|
543
543
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = k.create("languageUtils");
|
|
544
544
|
}
|
|
@@ -597,7 +597,7 @@ class ne {
|
|
|
597
597
|
}), s;
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
let
|
|
600
|
+
let xe = [{
|
|
601
601
|
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
602
602
|
nr: [1, 2],
|
|
603
603
|
fc: 1
|
|
@@ -689,7 +689,7 @@ let ye = [{
|
|
|
689
689
|
lngs: ["he", "iw"],
|
|
690
690
|
nr: [1, 2, 20, 21],
|
|
691
691
|
fc: 22
|
|
692
|
-
}],
|
|
692
|
+
}], Se = {
|
|
693
693
|
1: function(i) {
|
|
694
694
|
return +(i > 1);
|
|
695
695
|
},
|
|
@@ -757,7 +757,7 @@ let ye = [{
|
|
|
757
757
|
return i == 1 ? 0 : i == 2 ? 1 : (i < 0 || i > 10) && i % 10 == 0 ? 2 : 3;
|
|
758
758
|
}
|
|
759
759
|
};
|
|
760
|
-
const
|
|
760
|
+
const ve = ["v1", "v2", "v3"], Le = ["v4"], ie = {
|
|
761
761
|
zero: 0,
|
|
762
762
|
one: 1,
|
|
763
763
|
two: 2,
|
|
@@ -765,21 +765,21 @@ const xe = ["v1", "v2", "v3"], Se = ["v4"], se = {
|
|
|
765
765
|
many: 4,
|
|
766
766
|
other: 5
|
|
767
767
|
};
|
|
768
|
-
function
|
|
768
|
+
function Oe() {
|
|
769
769
|
const i = {};
|
|
770
|
-
return
|
|
770
|
+
return xe.forEach((e) => {
|
|
771
771
|
e.lngs.forEach((t) => {
|
|
772
772
|
i[t] = {
|
|
773
773
|
numbers: e.nr,
|
|
774
|
-
plurals:
|
|
774
|
+
plurals: Se[e.fc]
|
|
775
775
|
};
|
|
776
776
|
});
|
|
777
777
|
}), i;
|
|
778
778
|
}
|
|
779
|
-
class
|
|
779
|
+
class we {
|
|
780
780
|
constructor(e) {
|
|
781
781
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
782
|
-
this.languageUtils = e, this.options = t, this.logger = k.create("pluralResolver"), (!this.options.compatibilityJSON ||
|
|
782
|
+
this.languageUtils = e, this.options = t, this.logger = k.create("pluralResolver"), (!this.options.compatibilityJSON || Le.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Oe();
|
|
783
783
|
}
|
|
784
784
|
addRule(e, t) {
|
|
785
785
|
this.rules[e] = t;
|
|
@@ -808,7 +808,7 @@ class Le {
|
|
|
808
808
|
getSuffixes(e) {
|
|
809
809
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
810
810
|
const n = this.getRule(e, t);
|
|
811
|
-
return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((s, r) =>
|
|
811
|
+
return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((s, r) => ie[s] - ie[r]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : n.numbers.map((s) => this.getSuffix(e, s, t)) : [];
|
|
812
812
|
}
|
|
813
813
|
getSuffix(e, t) {
|
|
814
814
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -823,14 +823,14 @@ class Le {
|
|
|
823
823
|
return this.options.compatibilityJSON === "v1" ? s === 1 ? "" : typeof s == "number" ? `_plural_${s.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? r() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
|
|
824
824
|
}
|
|
825
825
|
shouldUseIntlApi() {
|
|
826
|
-
return !
|
|
826
|
+
return !ve.includes(this.options.compatibilityJSON);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r =
|
|
829
|
+
function re(i, e, t) {
|
|
830
|
+
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = de(i, e, t);
|
|
831
831
|
return !r && s && typeof t == "string" && (r = J(i, t, n), r === void 0 && (r = J(e, t, n))), r;
|
|
832
832
|
}
|
|
833
|
-
class
|
|
833
|
+
class Ne {
|
|
834
834
|
constructor() {
|
|
835
835
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
836
836
|
this.logger = k.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
@@ -841,7 +841,7 @@ class Oe {
|
|
|
841
841
|
escapeValue: !0
|
|
842
842
|
});
|
|
843
843
|
const t = e.interpolation;
|
|
844
|
-
this.escape = t.escape !== void 0 ? t.escape :
|
|
844
|
+
this.escape = t.escape !== void 0 ? t.escape : me, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? I(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? I(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? I(t.nestingPrefix) : t.nestingPrefixEscaped || I("$t("), this.nestingSuffix = t.nestingSuffix ? I(t.nestingSuffix) : t.nestingSuffixEscaped || I(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
|
|
845
845
|
}
|
|
846
846
|
reset() {
|
|
847
847
|
this.options && this.init(this.options);
|
|
@@ -862,7 +862,7 @@ class Oe {
|
|
|
862
862
|
}
|
|
863
863
|
const g = (p) => {
|
|
864
864
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
865
|
-
const O =
|
|
865
|
+
const O = re(t, o, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
866
866
|
return this.alwaysFormat ? this.format(O, void 0, n, {
|
|
867
867
|
...s,
|
|
868
868
|
...t,
|
|
@@ -870,7 +870,7 @@ class Oe {
|
|
|
870
870
|
}) : O;
|
|
871
871
|
}
|
|
872
872
|
const x = p.split(this.formatSeparator), v = x.shift().trim(), P = x.join(this.formatSeparator).trim();
|
|
873
|
-
return this.format(
|
|
873
|
+
return this.format(re(t, o, v, this.options.keySeparator, this.options.ignoreJSONStructure), P, n, {
|
|
874
874
|
...s,
|
|
875
875
|
...t,
|
|
876
876
|
interpolationkey: v
|
|
@@ -898,7 +898,7 @@ class Oe {
|
|
|
898
898
|
continue;
|
|
899
899
|
} else
|
|
900
900
|
this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`), a = "";
|
|
901
|
-
else typeof a != "string" && !this.useRawValueToEscape && (a =
|
|
901
|
+
else typeof a != "string" && !this.useRawValueToEscape && (a = _(a));
|
|
902
902
|
const v = p.safeValue(a);
|
|
903
903
|
if (e = e.replace(r[0], v), u ? (p.regex.lastIndex += a.length, p.regex.lastIndex -= r[0].length) : p.regex.lastIndex = 0, l++, l >= this.maxReplaces)
|
|
904
904
|
break;
|
|
@@ -936,7 +936,7 @@ class Oe {
|
|
|
936
936
|
s[1] = g.shift(), o = g, f = !0;
|
|
937
937
|
}
|
|
938
938
|
if (r = t(l.call(this, s[1].trim(), a), a), r && s[0] === e && typeof r != "string") return r;
|
|
939
|
-
typeof r != "string" && (r =
|
|
939
|
+
typeof r != "string" && (r = _(r)), r || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), r = ""), f && (r = o.reduce((g, c) => this.format(g, c, n.lng, {
|
|
940
940
|
...n,
|
|
941
941
|
interpolationkey: s[1].trim()
|
|
942
942
|
}), r.trim())), e = e.replace(s[0], r), this.regexp.lastIndex = 0;
|
|
@@ -944,7 +944,7 @@ class Oe {
|
|
|
944
944
|
return e;
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function Pe(i) {
|
|
948
948
|
let e = i.toLowerCase().trim();
|
|
949
949
|
const t = {};
|
|
950
950
|
if (i.indexOf("(") > -1) {
|
|
@@ -970,7 +970,7 @@ function A(i) {
|
|
|
970
970
|
return l || (l = i(z(s), r), e[a] = l), l(n);
|
|
971
971
|
};
|
|
972
972
|
}
|
|
973
|
-
class
|
|
973
|
+
class Re {
|
|
974
974
|
constructor() {
|
|
975
975
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
976
976
|
this.logger = k.create("formatter"), this.options = e, this.formats = {
|
|
@@ -1025,7 +1025,7 @@ class Ne {
|
|
|
1025
1025
|
const {
|
|
1026
1026
|
formatName: f,
|
|
1027
1027
|
formatOptions: g
|
|
1028
|
-
} =
|
|
1028
|
+
} = Pe(o);
|
|
1029
1029
|
if (this.formats[f]) {
|
|
1030
1030
|
let c = l;
|
|
1031
1031
|
try {
|
|
@@ -1045,10 +1045,10 @@ class Ne {
|
|
|
1045
1045
|
}, e);
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function Ce(i, e) {
|
|
1049
1049
|
i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
|
|
1050
1050
|
}
|
|
1051
|
-
class
|
|
1051
|
+
class Fe extends Y {
|
|
1052
1052
|
constructor(e, t, n) {
|
|
1053
1053
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1054
1054
|
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = s, this.logger = k.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n, s.backend, s);
|
|
@@ -1079,7 +1079,7 @@ class Re extends Y {
|
|
|
1079
1079
|
t && this.emit("failedLoading", r, a, t), n && this.store.addResourceBundle(r, a, n), this.state[e] = t ? -1 : 2;
|
|
1080
1080
|
const l = {};
|
|
1081
1081
|
this.queue.forEach((o) => {
|
|
1082
|
-
|
|
1082
|
+
ce(o.loaded, [r], a), Ce(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((f) => {
|
|
1083
1083
|
l[f] || (l[f] = {});
|
|
1084
1084
|
const g = o.loaded[f];
|
|
1085
1085
|
g.length && g.forEach((c) => {
|
|
@@ -1181,7 +1181,7 @@ class Re extends Y {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function ae() {
|
|
1185
1185
|
return {
|
|
1186
1186
|
debug: !1,
|
|
1187
1187
|
initImmediate: !0,
|
|
@@ -1240,12 +1240,12 @@ function re() {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function oe(i) {
|
|
1244
1244
|
return typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i;
|
|
1245
1245
|
}
|
|
1246
1246
|
function U() {
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function $e(i) {
|
|
1249
1249
|
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
1250
1250
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
1251
1251
|
});
|
|
@@ -1253,9 +1253,9 @@ function Ce(i) {
|
|
|
1253
1253
|
class V extends Y {
|
|
1254
1254
|
constructor() {
|
|
1255
1255
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1256
|
-
if (super(), this.options =
|
|
1256
|
+
if (super(), this.options = oe(e), this.services = {}, this.logger = k, this.modules = {
|
|
1257
1257
|
external: []
|
|
1258
|
-
},
|
|
1258
|
+
}, $e(this), t && !this.isInitialized && !e.isClone) {
|
|
1259
1259
|
if (!this.options.initImmediate)
|
|
1260
1260
|
return this.init(e, t), this;
|
|
1261
1261
|
setTimeout(() => {
|
|
@@ -1267,11 +1267,11 @@ class V extends Y {
|
|
|
1267
1267
|
var e = this;
|
|
1268
1268
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
|
|
1269
1269
|
typeof t == "function" && (n = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (typeof t.ns == "string" ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1270
|
-
const s =
|
|
1270
|
+
const s = ae();
|
|
1271
1271
|
this.options = {
|
|
1272
1272
|
...s,
|
|
1273
1273
|
...this.options,
|
|
1274
|
-
...
|
|
1274
|
+
...oe(t)
|
|
1275
1275
|
}, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
|
|
1276
1276
|
...s.interpolation,
|
|
1277
1277
|
...this.options.interpolation
|
|
@@ -1282,17 +1282,17 @@ class V extends Y {
|
|
|
1282
1282
|
if (!this.options.isClone) {
|
|
1283
1283
|
this.modules.logger ? k.init(r(this.modules.logger), this.options) : k.init(null, this.options);
|
|
1284
1284
|
let g;
|
|
1285
|
-
this.modules.formatter ? g = this.modules.formatter : typeof Intl < "u" && (g =
|
|
1286
|
-
const c = new
|
|
1287
|
-
this.store = new
|
|
1285
|
+
this.modules.formatter ? g = this.modules.formatter : typeof Intl < "u" && (g = Re);
|
|
1286
|
+
const c = new se(this.options);
|
|
1287
|
+
this.store = new te(this.options.resources, this.options);
|
|
1288
1288
|
const u = this.services;
|
|
1289
|
-
u.logger = k, u.resourceStore = this.store, u.languageUtils = c, u.pluralResolver = new
|
|
1289
|
+
u.logger = k, u.resourceStore = this.store, u.languageUtils = c, u.pluralResolver = new we(c, {
|
|
1290
1290
|
prepend: this.options.pluralSeparator,
|
|
1291
1291
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
1292
1292
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1293
|
-
}), g && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (u.formatter = r(g), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new
|
|
1293
|
+
}), g && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (u.formatter = r(g), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new Ne(this.options), u.utils = {
|
|
1294
1294
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1295
|
-
}, u.backendConnector = new
|
|
1295
|
+
}, u.backendConnector = new Fe(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(m) {
|
|
1296
1296
|
for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), v = 1; v < p; v++)
|
|
1297
1297
|
x[v - 1] = arguments[v];
|
|
1298
1298
|
e.emit(m, ...x);
|
|
@@ -1352,7 +1352,7 @@ class V extends Y {
|
|
|
1352
1352
|
use(e) {
|
|
1353
1353
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1354
1354
|
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1355
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
1355
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && fe.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1356
1356
|
}
|
|
1357
1357
|
setResolvedLanguage(e) {
|
|
1358
1358
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
@@ -1450,7 +1450,7 @@ class V extends Y {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
dir(e) {
|
|
1452
1452
|
if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1453
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services && this.services.languageUtils || new
|
|
1453
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services && this.services.languageUtils || new se(ae());
|
|
1454
1454
|
return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1455
1455
|
}
|
|
1456
1456
|
static createInstance() {
|
|
@@ -1472,7 +1472,7 @@ class V extends Y {
|
|
|
1472
1472
|
...this.services
|
|
1473
1473
|
}, r.services.utils = {
|
|
1474
1474
|
hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
|
|
1475
|
-
}, n && (r.store = new
|
|
1475
|
+
}, n && (r.store = new te(this.store.data, s), r.services.resourceStore = r.store), r.translator = new W(r.services, s), r.translator.on("*", function(l) {
|
|
1476
1476
|
for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), g = 1; g < o; g++)
|
|
1477
1477
|
f[g - 1] = arguments[g];
|
|
1478
1478
|
r.emit(l, ...f);
|
|
@@ -1506,47 +1506,51 @@ C.setDefaultNamespace;
|
|
|
1506
1506
|
C.hasLoadedNamespace;
|
|
1507
1507
|
C.loadNamespaces;
|
|
1508
1508
|
C.loadLanguages;
|
|
1509
|
-
var
|
|
1509
|
+
var G = {};
|
|
1510
1510
|
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
function
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
var
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
for (
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1511
|
+
var le;
|
|
1512
|
+
function ke() {
|
|
1513
|
+
return le || (le = 1, function(i) {
|
|
1514
|
+
(function(e) {
|
|
1515
|
+
e(typeof DO_NOT_EXPORT_CRC > "u" ? i : {});
|
|
1516
|
+
})(function(e) {
|
|
1517
|
+
e.version = "1.2.2";
|
|
1518
|
+
function t() {
|
|
1519
|
+
for (var h = 0, N = new Array(256), d = 0; d != 256; ++d)
|
|
1520
|
+
h = d, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, N[d] = h;
|
|
1521
|
+
return typeof Int32Array < "u" ? new Int32Array(N) : N;
|
|
1522
|
+
}
|
|
1523
|
+
var n = t();
|
|
1524
|
+
function s(h) {
|
|
1525
|
+
var N = 0, d = 0, y = 0, b = typeof Int32Array < "u" ? new Int32Array(4096) : new Array(4096);
|
|
1526
|
+
for (y = 0; y != 256; ++y) b[y] = h[y];
|
|
1527
|
+
for (y = 0; y != 256; ++y)
|
|
1528
|
+
for (d = h[y], N = 256 + y; N < 4096; N += 256) d = b[N] = d >>> 8 ^ h[d & 255];
|
|
1529
|
+
var S = [];
|
|
1530
|
+
for (y = 1; y != 16; ++y) S[y - 1] = typeof Int32Array < "u" ? b.subarray(y * 256, y * 256 + 256) : b.slice(y * 256, y * 256 + 256);
|
|
1531
|
+
return S;
|
|
1532
|
+
}
|
|
1533
|
+
var r = s(n), a = r[0], l = r[1], o = r[2], f = r[3], g = r[4], c = r[5], u = r[6], m = r[7], p = r[8], x = r[9], v = r[10], P = r[11], O = r[12], T = r[13], L = r[14];
|
|
1534
|
+
function R(h, N) {
|
|
1535
|
+
for (var d = N ^ -1, y = 0, b = h.length; y < b; ) d = d >>> 8 ^ n[(d ^ h.charCodeAt(y++)) & 255];
|
|
1536
|
+
return ~d;
|
|
1537
|
+
}
|
|
1538
|
+
function $(h, N) {
|
|
1539
|
+
for (var d = N ^ -1, y = h.length - 15, b = 0; b < y; ) d = L[h[b++] ^ d & 255] ^ T[h[b++] ^ d >> 8 & 255] ^ O[h[b++] ^ d >> 16 & 255] ^ P[h[b++] ^ d >>> 24] ^ v[h[b++]] ^ x[h[b++]] ^ p[h[b++]] ^ m[h[b++]] ^ u[h[b++]] ^ c[h[b++]] ^ g[h[b++]] ^ f[h[b++]] ^ o[h[b++]] ^ l[h[b++]] ^ a[h[b++]] ^ n[h[b++]];
|
|
1540
|
+
for (y += 15; b < y; ) d = d >>> 8 ^ n[(d ^ h[b++]) & 255];
|
|
1541
|
+
return ~d;
|
|
1542
|
+
}
|
|
1543
|
+
function w(h, N) {
|
|
1544
|
+
for (var d = N ^ -1, y = 0, b = h.length, S = 0, j = 0; y < b; )
|
|
1545
|
+
S = h.charCodeAt(y++), S < 128 ? d = d >>> 8 ^ n[(d ^ S) & 255] : S < 2048 ? (d = d >>> 8 ^ n[(d ^ (192 | S >> 6 & 31)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S & 63)) & 255]) : S >= 55296 && S < 57344 ? (S = (S & 1023) + 64, j = h.charCodeAt(y++) & 1023, d = d >>> 8 ^ n[(d ^ (240 | S >> 8 & 7)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S >> 2 & 63)) & 255], d = d >>> 8 ^ n[(d ^ (128 | j >> 6 & 15 | (S & 3) << 4)) & 255], d = d >>> 8 ^ n[(d ^ (128 | j & 63)) & 255]) : (d = d >>> 8 ^ n[(d ^ (224 | S >> 12 & 15)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S >> 6 & 63)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S & 63)) & 255]);
|
|
1546
|
+
return ~d;
|
|
1547
|
+
}
|
|
1548
|
+
e.table = n, e.bstr = R, e.buf = $, e.str = w;
|
|
1549
|
+
});
|
|
1550
|
+
}(G)), G;
|
|
1551
|
+
}
|
|
1552
|
+
var je = ke();
|
|
1549
1553
|
export {
|
|
1550
|
-
|
|
1554
|
+
je as c,
|
|
1551
1555
|
C as i
|
|
1552
1556
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContext as i } from "react";
|
|
2
2
|
import { TranslationContext as u } from "../provider/translation-provider.js";
|
|
3
|
-
import { c } from "../crc32-
|
|
4
|
-
import { u as l } from "../useTranslation-
|
|
5
|
-
function
|
|
3
|
+
import { c } from "../crc32-BeCcwohL.js";
|
|
4
|
+
import { u as l } from "../useTranslation-CZfO55Z-.js";
|
|
5
|
+
function d() {
|
|
6
6
|
const t = i(u), { ready: r, t: a, i18n: o } = l(), e = (n, s = {}) => a(c.str(n).toString(), { defaultValue: n, ...s });
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error(
|
|
@@ -17,5 +17,5 @@ function h() {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
d as default
|
|
21
21
|
};
|