@deriv-com/translations 1.4.0 → 1.4.3
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/chunk-CzZxQCTN.js +14 -0
- package/dist/components/index.js +2 -4
- package/dist/components/localize.js +18 -386
- package/dist/hooks/index.js +2 -4
- package/dist/hooks/use-translations.js +23 -20
- package/dist/index.js +9 -16
- package/dist/jsx-runtime-22qKqdB2.js +180 -0
- package/dist/provider/index.js +2 -5
- package/dist/provider/translation-provider.js +26 -46
- package/dist/{components → src/components}/localize.d.ts +2 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/{provider → src/provider}/translation-provider.d.ts +1 -1
- package/dist/{utils → src/utils}/lang-utils.d.ts +1 -1
- package/dist/utils/constants.js +34 -6
- package/dist/utils/index.js +5 -14
- package/dist/utils/initialize-i18n.js +2 -34
- package/dist/utils/lang-utils.js +2 -31
- package/dist/utils/localize.js +48 -9
- package/dist/utils/otasdk.js +19 -20
- package/dist/utils-CvIwp1ax.js +50 -0
- package/package.json +29 -28
- package/dist/constants-HKuDWVkt.js +0 -37
- package/dist/crc32-BeCcwohL.js +0 -1556
- package/dist/i18nInstance-D3STmr24.js +0 -55
- package/dist/index.d.ts +0 -4
- package/dist/jsx-runtime-oIKL5WiM.js +0 -634
- package/dist/useTranslation-CZfO55Z-.js +0 -129
- package/dist/utils/__tests__/lang-utils.spec.d.ts +0 -1
- /package/dist/{components → src/components}/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/use-translations.d.ts +0 -0
- /package/dist/{provider → src/provider}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/constants.d.ts +0 -0
- /package/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/initialize-i18n.d.ts +0 -0
- /package/dist/{utils → src/utils}/localize.d.ts +0 -0
- /package/dist/{utils → src/utils}/otasdk.d.ts +0 -0
package/dist/provider/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { TranslationContext as
|
|
2
|
-
export {
|
|
3
|
-
r as TranslationContext,
|
|
4
|
-
t as TranslationProvider
|
|
5
|
-
};
|
|
1
|
+
import e, { TranslationContext as t } from "./translation-provider.js";
|
|
2
|
+
export { t as TranslationContext, e as TranslationProvider };
|
|
@@ -1,47 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import "../
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import "../utils-CvIwp1ax.js";
|
|
3
|
+
import { LANGUAGE_KEY as e } from "../utils/constants.js";
|
|
4
|
+
import { t } from "../jsx-runtime-22qKqdB2.js";
|
|
5
|
+
import { I18nextProvider as n } from "react-i18next";
|
|
6
|
+
import { createContext as r, useEffect as i, useState as a } from "react";
|
|
7
|
+
//#region src/provider/translation-provider.tsx
|
|
8
|
+
var o = t(), s = r(null);
|
|
9
|
+
function c({ defaultLang: t, i18nInstance: r, children: c }) {
|
|
10
|
+
let [l, u] = a(t || ""), [d, f] = a(!1);
|
|
11
|
+
return i(() => {
|
|
12
|
+
r && (u(r.language || t || ""), f(!0));
|
|
13
|
+
}, [r, t]), !r || !d ? null : /* @__PURE__ */ (0, o.jsx)(n, {
|
|
14
|
+
i18n: r,
|
|
15
|
+
children: /* @__PURE__ */ (0, o.jsx)(s.Provider, {
|
|
16
|
+
value: {
|
|
17
|
+
currentLang: l,
|
|
18
|
+
switchLanguage: (t) => {
|
|
19
|
+
r.changeLanguage(t), u(t), localStorage.setItem(e, JSON.stringify(t));
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
children: c
|
|
23
|
+
})
|
|
24
|
+
});
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
defaultLang: t,
|
|
22
|
-
i18nInstance: e,
|
|
23
|
-
children: o
|
|
24
|
-
}) {
|
|
25
|
-
const [a, n] = i(t || ""), [u, l] = i(!1), c = (r) => {
|
|
26
|
-
e.changeLanguage(r), n(r), localStorage.setItem(L, JSON.stringify(r));
|
|
27
|
-
};
|
|
28
|
-
return x(() => {
|
|
29
|
-
if (e) {
|
|
30
|
-
const r = e.language || t || "";
|
|
31
|
-
n(r), l(!0);
|
|
32
|
-
}
|
|
33
|
-
}, [e, t]), !e || !u ? null : /* @__PURE__ */ s.jsx(p, { i18n: e, children: /* @__PURE__ */ s.jsx(
|
|
34
|
-
v.Provider,
|
|
35
|
-
{
|
|
36
|
-
value: {
|
|
37
|
-
currentLang: a,
|
|
38
|
-
switchLanguage: c
|
|
39
|
-
},
|
|
40
|
-
children: o
|
|
41
|
-
}
|
|
42
|
-
) });
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
v as TranslationContext,
|
|
46
|
-
P as default
|
|
47
|
-
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { s as TranslationContext, c as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { i18n } from 'i18next';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
type TLocalizeProps = {
|
|
3
4
|
i18n_default_text: string;
|
|
4
5
|
values?: object;
|
|
5
|
-
components?: JSX.Element[];
|
|
6
|
+
components?: React.JSX.Element[];
|
|
6
7
|
options?: Record<string, unknown>;
|
|
7
8
|
shouldUnescape?: boolean;
|
|
8
9
|
i18n?: i18n;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { localize, getInitialLanguage, loadIncontextTranslation, getAllowedLanguages, initializeI18n, } from '../utils/index';
|
|
2
|
+
export { Localize } from '../components/index';
|
|
3
|
+
export { useTranslations } from '../hooks/index';
|
|
4
|
+
export { TranslationProvider } from '../provider/index';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants } from '
|
|
1
|
+
import { constants } from '../../utils/index';
|
|
2
2
|
type LanguageCode = keyof typeof constants.ALL_LANGUAGES;
|
|
3
3
|
export declare const getInitialLanguage: () => any;
|
|
4
4
|
export declare const loadIncontextTranslation: (lang: LanguageCode) => void;
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { n as e } from "../chunk-CzZxQCTN.js";
|
|
2
|
+
//#region src/utils/constants.ts
|
|
3
|
+
var t = /* @__PURE__ */ e({
|
|
4
|
+
ALL_LANGUAGES: () => n,
|
|
5
|
+
DEFAULT_LANGUAGE: () => "EN",
|
|
6
|
+
LANGUAGE_KEY: () => r
|
|
7
|
+
}), n = Object.freeze({
|
|
8
|
+
ACH: "Translations",
|
|
9
|
+
EN: "English",
|
|
10
|
+
AR: "العربية",
|
|
11
|
+
BN: "বাংলা",
|
|
12
|
+
DE: "Deutsch",
|
|
13
|
+
ES: "Español",
|
|
14
|
+
FR: "Français",
|
|
15
|
+
ID: "Indonesian",
|
|
16
|
+
IT: "Italiano",
|
|
17
|
+
SW: "Kiswahili",
|
|
18
|
+
TA: "தமிழ்",
|
|
19
|
+
KM: "ខ្មែរ",
|
|
20
|
+
KO: "한국어",
|
|
21
|
+
MN: "Монгол",
|
|
22
|
+
PL: "Polish",
|
|
23
|
+
PT: "Português",
|
|
24
|
+
RU: "Русский",
|
|
25
|
+
SI: "සිංහල",
|
|
26
|
+
TH: "ไทย",
|
|
27
|
+
TR: "Türkçe",
|
|
28
|
+
UZ: "O'zbek",
|
|
29
|
+
VI: "Tiếng Việt",
|
|
30
|
+
ZH_CN: "简体中文",
|
|
31
|
+
ZH_TW: "繁體中文"
|
|
32
|
+
}), r = "i18n_language", i = "EN";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { n as ALL_LANGUAGES, i as DEFAULT_LANGUAGE, r as LANGUAGE_KEY, t };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
r as OtaSdk,
|
|
8
|
-
i as constants,
|
|
9
|
-
d as getAllowedLanguages,
|
|
10
|
-
g as getInitialLanguage,
|
|
11
|
-
e as initializeI18n,
|
|
12
|
-
x as loadIncontextTranslation,
|
|
13
|
-
l as localize
|
|
14
|
-
};
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../utils-CvIwp1ax.js";
|
|
2
|
+
import i from "./localize.js";
|
|
3
|
+
import a from "./otasdk.js";
|
|
4
|
+
import { t as o } from "./constants.js";
|
|
5
|
+
export { a as OtaSdk, o as constants, r as getAllowedLanguages, t as getInitialLanguage, e as initializeI18n, n as loadIncontextTranslation, i as localize };
|
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
|
|
3
|
-
import { getInitialLanguage as l } from "./lang-utils.js";
|
|
4
|
-
import { s as u, a as f } from "../i18nInstance-D3STmr24.js";
|
|
5
|
-
const m = {
|
|
6
|
-
type: "3rdParty",
|
|
7
|
-
init(t) {
|
|
8
|
-
u(t.options.react), f(t);
|
|
9
|
-
}
|
|
10
|
-
}, g = ({ useSuspense: t, enableDebug: e }) => ({
|
|
11
|
-
react: {
|
|
12
|
-
hashTransKey(n) {
|
|
13
|
-
return o.str(n);
|
|
14
|
-
},
|
|
15
|
-
useSuspense: t
|
|
16
|
-
},
|
|
17
|
-
debug: e,
|
|
18
|
-
initImmediate: !0,
|
|
19
|
-
fallbackLng: "EN",
|
|
20
|
-
interpolation: {
|
|
21
|
-
escapeValue: !1
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function y({
|
|
25
|
-
cdnUrl: t,
|
|
26
|
-
useSuspense: e = !0,
|
|
27
|
-
enableDebug: n = !1
|
|
28
|
-
}) {
|
|
29
|
-
const i = new c(t), s = l(), r = g({ useSuspense: e, enableDebug: n });
|
|
30
|
-
return a.use(i).use(m).init({ ...r, lng: s }), a;
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
y as default
|
|
34
|
-
};
|
|
1
|
+
import { i as e } from "../utils-CvIwp1ax.js";
|
|
2
|
+
export { e as default };
|
package/dist/utils/lang-utils.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
|
|
3
|
-
const p = () => {
|
|
4
|
-
const a = new URLSearchParams(window.location.search).get("lang");
|
|
5
|
-
let t = localStorage.getItem(s) ?? '"EN"';
|
|
6
|
-
/^".*"$/.test(t) || (localStorage.setItem(s, JSON.stringify(t)), t = localStorage.getItem(s));
|
|
7
|
-
const e = JSON.parse(t);
|
|
8
|
-
if (a) {
|
|
9
|
-
const r = a.toUpperCase();
|
|
10
|
-
return localStorage.setItem(s, JSON.stringify(r)), r;
|
|
11
|
-
}
|
|
12
|
-
return e || c;
|
|
13
|
-
}, g = (n) => {
|
|
14
|
-
if (n.toUpperCase() === "ACH") {
|
|
15
|
-
const t = document.createElement("script");
|
|
16
|
-
t.type = "text/javascript", t.text = `
|
|
17
|
-
var _jipt = []; _jipt.push(['project', 'deriv-app']);
|
|
18
|
-
var crowdin = document.createElement("script");
|
|
19
|
-
crowdin.setAttribute('src', '//cdn.crowdin.com/jipt/jipt.js');
|
|
20
|
-
document.head.appendChild(crowdin);
|
|
21
|
-
`, document.head.appendChild(t);
|
|
22
|
-
}
|
|
23
|
-
}, u = (n = []) => {
|
|
24
|
-
const a = ["ACH", ...n];
|
|
25
|
-
return Object.keys(o).filter((e) => !a.includes(e)).reduce((e, r) => (e[r] = o[r], e), {});
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
u as getAllowedLanguages,
|
|
29
|
-
p as getInitialLanguage,
|
|
30
|
-
g as loadIncontextTranslation
|
|
31
|
-
};
|
|
1
|
+
import { n as e, r as t, t as n } from "../utils-CvIwp1ax.js";
|
|
2
|
+
export { n as getAllowedLanguages, e as getInitialLanguage, t as loadIncontextTranslation };
|
package/dist/utils/localize.js
CHANGED
|
@@ -1,10 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { t as e } from "../chunk-CzZxQCTN.js";
|
|
2
|
+
import t from "i18next";
|
|
3
|
+
//#region node_modules/crc-32/crc32.js
|
|
4
|
+
var n = /* @__PURE__ */ e(((e) => {
|
|
5
|
+
(function(t) {
|
|
6
|
+
typeof DO_NOT_EXPORT_CRC > "u" ? typeof e == "object" ? t(e) : typeof define == "function" && define.amd ? define(function() {
|
|
7
|
+
var e = {};
|
|
8
|
+
return t(e), e;
|
|
9
|
+
}) : t({}) : t({});
|
|
10
|
+
})(function(e) {
|
|
11
|
+
e.version = "1.2.2";
|
|
12
|
+
function t() {
|
|
13
|
+
for (var e = 0, t = Array(256), n = 0; n != 256; ++n) e = n, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, e = e & 1 ? -306674912 ^ e >>> 1 : e >>> 1, t[n] = e;
|
|
14
|
+
return typeof Int32Array < "u" ? new Int32Array(t) : t;
|
|
15
|
+
}
|
|
16
|
+
var n = t();
|
|
17
|
+
function r(e) {
|
|
18
|
+
var t = 0, n = 0, r = 0, i = typeof Int32Array < "u" ? new Int32Array(4096) : Array(4096);
|
|
19
|
+
for (r = 0; r != 256; ++r) i[r] = e[r];
|
|
20
|
+
for (r = 0; r != 256; ++r) for (n = e[r], t = 256 + r; t < 4096; t += 256) n = i[t] = n >>> 8 ^ e[n & 255];
|
|
21
|
+
var a = [];
|
|
22
|
+
for (r = 1; r != 16; ++r) a[r - 1] = typeof Int32Array < "u" ? i.subarray(r * 256, r * 256 + 256) : i.slice(r * 256, r * 256 + 256);
|
|
23
|
+
return a;
|
|
24
|
+
}
|
|
25
|
+
var i = r(n), a = i[0], o = i[1], s = i[2], c = i[3], l = i[4], u = i[5], d = i[6], f = i[7], p = i[8], m = i[9], h = i[10], g = i[11], _ = i[12], v = i[13], y = i[14];
|
|
26
|
+
function b(e, t) {
|
|
27
|
+
for (var r = t ^ -1, i = 0, a = e.length; i < a;) r = r >>> 8 ^ n[(r ^ e.charCodeAt(i++)) & 255];
|
|
28
|
+
return ~r;
|
|
29
|
+
}
|
|
30
|
+
function x(e, t) {
|
|
31
|
+
for (var r = t ^ -1, i = e.length - 15, b = 0; b < i;) r = y[e[b++] ^ r & 255] ^ v[e[b++] ^ r >> 8 & 255] ^ _[e[b++] ^ r >> 16 & 255] ^ g[e[b++] ^ r >>> 24] ^ h[e[b++]] ^ m[e[b++]] ^ p[e[b++]] ^ f[e[b++]] ^ d[e[b++]] ^ u[e[b++]] ^ l[e[b++]] ^ c[e[b++]] ^ s[e[b++]] ^ o[e[b++]] ^ a[e[b++]] ^ n[e[b++]];
|
|
32
|
+
for (i += 15; b < i;) r = r >>> 8 ^ n[(r ^ e[b++]) & 255];
|
|
33
|
+
return ~r;
|
|
34
|
+
}
|
|
35
|
+
function S(e, t) {
|
|
36
|
+
for (var r = t ^ -1, i = 0, a = e.length, o = 0, s = 0; i < a;) o = e.charCodeAt(i++), o < 128 ? r = r >>> 8 ^ n[(r ^ o) & 255] : o < 2048 ? (r = r >>> 8 ^ n[(r ^ (192 | o >> 6 & 31)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o & 63)) & 255]) : o >= 55296 && o < 57344 ? (o = (o & 1023) + 64, s = e.charCodeAt(i++) & 1023, r = r >>> 8 ^ n[(r ^ (240 | o >> 8 & 7)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o >> 2 & 63)) & 255], r = r >>> 8 ^ n[(r ^ (128 | s >> 6 & 15 | (o & 3) << 4)) & 255], r = r >>> 8 ^ n[(r ^ (128 | s & 63)) & 255]) : (r = r >>> 8 ^ n[(r ^ (224 | o >> 12 & 15)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o >> 6 & 63)) & 255], r = r >>> 8 ^ n[(r ^ (128 | o & 63)) & 255]);
|
|
37
|
+
return ~r;
|
|
38
|
+
}
|
|
39
|
+
e.table = n, e.bstr = b, e.buf = x, e.str = S;
|
|
40
|
+
});
|
|
41
|
+
})), r = n();
|
|
42
|
+
function i(e, n) {
|
|
43
|
+
return e ? t.t((0, r.str)(e).toString(), {
|
|
44
|
+
defaultValue: e,
|
|
45
|
+
...n
|
|
46
|
+
}) : "";
|
|
7
47
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { i as default, n as t };
|
package/dist/utils/otasdk.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
a as default
|
|
1
|
+
//#region src/utils/otasdk.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
type;
|
|
4
|
+
cdnUrl;
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.type = "backend", this.cdnUrl = e;
|
|
7
|
+
}
|
|
8
|
+
read(e, t, n) {
|
|
9
|
+
fetch(this.cdnUrl + "/translations/" + e.toLowerCase() + ".json").then((e) => {
|
|
10
|
+
if (!e.ok) throw Error("Failed to fetch translations");
|
|
11
|
+
return e.json();
|
|
12
|
+
}).then((e) => {
|
|
13
|
+
n(null, e);
|
|
14
|
+
}).catch(() => {
|
|
15
|
+
n(null, {});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
21
18
|
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { e as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as e } from "./utils/localize.js";
|
|
2
|
+
import t from "./utils/otasdk.js";
|
|
3
|
+
import { ALL_LANGUAGES as n, LANGUAGE_KEY as r } from "./utils/constants.js";
|
|
4
|
+
import i from "i18next";
|
|
5
|
+
import { initReactI18next as a } from "react-i18next";
|
|
6
|
+
//#region src/utils/initialize-i18n.ts
|
|
7
|
+
var o = e(), s = ({ useSuspense: e, enableDebug: t }) => ({
|
|
8
|
+
react: {
|
|
9
|
+
hashTransKey(e) {
|
|
10
|
+
return (0, o.str)(e);
|
|
11
|
+
},
|
|
12
|
+
useSuspense: e
|
|
13
|
+
},
|
|
14
|
+
debug: t,
|
|
15
|
+
initImmediate: !0,
|
|
16
|
+
fallbackLng: "EN",
|
|
17
|
+
interpolation: { escapeValue: !1 }
|
|
18
|
+
});
|
|
19
|
+
function c({ cdnUrl: e, useSuspense: n = !0, enableDebug: r = !1 }) {
|
|
20
|
+
let o = new t(e), c = l(), u = s({
|
|
21
|
+
useSuspense: n,
|
|
22
|
+
enableDebug: r
|
|
23
|
+
});
|
|
24
|
+
return i.use(o).use(a).init({
|
|
25
|
+
...u,
|
|
26
|
+
lng: c
|
|
27
|
+
}), i;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/utils/lang-utils.ts
|
|
31
|
+
var l = () => {
|
|
32
|
+
let e = new URLSearchParams(window.location.search).get("lang"), t = localStorage.getItem("i18n_language") ?? "\"EN\"";
|
|
33
|
+
/^".*"$/.test(t) || (localStorage.setItem(r, JSON.stringify(t)), t = localStorage.getItem(r));
|
|
34
|
+
let n = JSON.parse(t);
|
|
35
|
+
if (e) {
|
|
36
|
+
let t = e.toUpperCase();
|
|
37
|
+
return localStorage.setItem(r, JSON.stringify(t)), t;
|
|
38
|
+
}
|
|
39
|
+
return n || "EN";
|
|
40
|
+
}, u = (e) => {
|
|
41
|
+
if (e.toUpperCase() === "ACH") {
|
|
42
|
+
let e = document.createElement("script");
|
|
43
|
+
e.type = "text/javascript", e.text = "\n var _jipt = []; _jipt.push(['project', 'deriv-app']);\n var crowdin = document.createElement(\"script\");\n crowdin.setAttribute('src', '//cdn.crowdin.com/jipt/jipt.js');\n document.head.appendChild(crowdin);\n ", document.head.appendChild(e);
|
|
44
|
+
}
|
|
45
|
+
}, d = (e = []) => {
|
|
46
|
+
let t = ["ACH", ...e];
|
|
47
|
+
return Object.keys(n).filter((e) => !t.includes(e)).reduce((e, t) => (e[t] = n[t], e), {});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { c as i, l as n, u as r, d as t };
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"deriv-extract-translations": "./dist/deriv-extract-translations.cjs"
|
|
11
11
|
},
|
|
12
12
|
"private": false,
|
|
13
|
-
"version": "1.4.
|
|
13
|
+
"version": "1.4.3",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"dev": "vite",
|
|
16
16
|
"build": "tsc && vite build && cp ./src/scripts/deriv-extract-translations.cjs ./dist/deriv-extract-translations.cjs",
|
|
@@ -23,40 +23,41 @@
|
|
|
23
23
|
"react-dom": "^17.x || ^18.x"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@babel/core": "^7.
|
|
26
|
+
"@babel/core": "^7.29.0",
|
|
27
27
|
"@semantic-release/changelog": "^6.0.3",
|
|
28
|
-
"@semantic-release/commit-analyzer": "^
|
|
29
|
-
"@semantic-release/github": "^
|
|
30
|
-
"@semantic-release/release-notes-generator": "^
|
|
31
|
-
"@testing-library/jest-dom": "^6.
|
|
32
|
-
"@testing-library/react": "^
|
|
33
|
-
"@testing-library/user-event": "^14.
|
|
34
|
-
"@types/
|
|
35
|
-
"@types/react
|
|
36
|
-
"@
|
|
37
|
-
"@typescript-eslint/
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"eslint
|
|
41
|
-
"eslint-plugin-react-
|
|
42
|
-
"
|
|
28
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
29
|
+
"@semantic-release/github": "^12.0.6",
|
|
30
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
31
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
32
|
+
"@testing-library/react": "^16.3.2",
|
|
33
|
+
"@testing-library/user-event": "^14.6.1",
|
|
34
|
+
"@types/node": "^25.6.0",
|
|
35
|
+
"@types/react": "^19.2.14",
|
|
36
|
+
"@types/react-dom": "^19.2.3",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
39
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
40
|
+
"eslint": "^9.39.4",
|
|
41
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
43
|
+
"i18next": "^26.0.3",
|
|
43
44
|
"jsdom": "^24.0.0",
|
|
44
|
-
"react": "^
|
|
45
|
-
"react-dom": "^
|
|
46
|
-
"react-i18next": "^
|
|
47
|
-
"semantic-release": "^
|
|
48
|
-
"typescript": "^
|
|
49
|
-
"vite": "^
|
|
45
|
+
"react": "^19.2.4",
|
|
46
|
+
"react-dom": "^19.2.4",
|
|
47
|
+
"react-i18next": "^17.0.2",
|
|
48
|
+
"semantic-release": "^25.0.3",
|
|
49
|
+
"typescript": "^6.0.2",
|
|
50
|
+
"vite": "^8.0.4",
|
|
50
51
|
"vite-plugin-dts": "^4.5.4",
|
|
51
|
-
"vitest": "^
|
|
52
|
+
"vitest": "^4.1.2"
|
|
52
53
|
},
|
|
53
54
|
"optionalDependencies": {
|
|
54
|
-
"@rollup/rollup-linux-x64-gnu": "^4.
|
|
55
|
+
"@rollup/rollup-linux-x64-gnu": "^4.60.1"
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
|
-
"@xmldom/xmldom": "^0.
|
|
58
|
-
"commander": "^
|
|
58
|
+
"@xmldom/xmldom": "^0.9.9",
|
|
59
|
+
"commander": "^14.0.3",
|
|
59
60
|
"crc-32": "^1.2.2",
|
|
60
|
-
"glob": "^
|
|
61
|
+
"glob": "^13.0.6"
|
|
61
62
|
}
|
|
62
63
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const e = Object.freeze({
|
|
2
|
-
ACH: "Translations",
|
|
3
|
-
EN: "English",
|
|
4
|
-
AR: "العربية",
|
|
5
|
-
BN: "বাংলা",
|
|
6
|
-
DE: "Deutsch",
|
|
7
|
-
ES: "Español",
|
|
8
|
-
FR: "Français",
|
|
9
|
-
ID: "Indonesian",
|
|
10
|
-
IT: "Italiano",
|
|
11
|
-
SW: "Kiswahili",
|
|
12
|
-
TA: "தமிழ்",
|
|
13
|
-
KM: "ខ្មែរ",
|
|
14
|
-
KO: "한국어",
|
|
15
|
-
MN: "Монгол",
|
|
16
|
-
PL: "Polish",
|
|
17
|
-
PT: "Português",
|
|
18
|
-
RU: "Русский",
|
|
19
|
-
SI: "සිංහල",
|
|
20
|
-
TH: "ไทย",
|
|
21
|
-
TR: "Türkçe",
|
|
22
|
-
UZ: "O'zbek",
|
|
23
|
-
VI: "Tiếng Việt",
|
|
24
|
-
ZH_CN: "简体中文",
|
|
25
|
-
ZH_TW: "繁體中文"
|
|
26
|
-
}), n = "i18n_language", s = "EN", t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
27
|
-
__proto__: null,
|
|
28
|
-
ALL_LANGUAGES: e,
|
|
29
|
-
DEFAULT_LANGUAGE: s,
|
|
30
|
-
LANGUAGE_KEY: n
|
|
31
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
32
|
-
export {
|
|
33
|
-
e as A,
|
|
34
|
-
s as D,
|
|
35
|
-
n as L,
|
|
36
|
-
t as c
|
|
37
|
-
};
|