@deriv-com/translations 1.3.6 → 1.3.8
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/utils/lang-utils.js +17 -14
- package/package.json +1 -1
package/dist/utils/lang-utils.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import "../crc32-LCGpXEbE.js";
|
|
2
|
-
import { L as s, D as
|
|
3
|
-
const
|
|
4
|
-
const a = new URLSearchParams(window.location.search).get("lang")
|
|
2
|
+
import { L as s, D as c, A as o } from "../constants-D-_KboaS.js";
|
|
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);
|
|
5
8
|
if (a) {
|
|
6
|
-
const
|
|
7
|
-
return localStorage.setItem(s, JSON.stringify(
|
|
9
|
+
const r = a.toUpperCase();
|
|
10
|
+
return localStorage.setItem(s, JSON.stringify(r)), r;
|
|
8
11
|
}
|
|
9
|
-
return
|
|
10
|
-
},
|
|
11
|
-
if (
|
|
12
|
+
return e || c;
|
|
13
|
+
}, g = (n) => {
|
|
14
|
+
if (n.toUpperCase() === "ACH") {
|
|
12
15
|
const t = document.createElement("script");
|
|
13
16
|
t.type = "text/javascript", t.text = `
|
|
14
17
|
var _jipt = []; _jipt.push(['project', 'deriv-app']);
|
|
@@ -17,12 +20,12 @@ const l = () => {
|
|
|
17
20
|
document.head.appendChild(crowdin);
|
|
18
21
|
`, document.head.appendChild(t);
|
|
19
22
|
}
|
|
20
|
-
},
|
|
21
|
-
const a = ["ACH", ...
|
|
22
|
-
return Object.keys(
|
|
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), {});
|
|
23
26
|
};
|
|
24
27
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
u as getAllowedLanguages,
|
|
29
|
+
p as getInitialLanguage,
|
|
30
|
+
g as loadIncontextTranslation
|
|
28
31
|
};
|
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.3.
|
|
13
|
+
"version": "1.3.8",
|
|
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",
|