@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.
@@ -1,6 +1,5 @@
1
1
  import { constants } from '../utils/index';
2
2
  import { i18n as Ti18n } from 'i18next';
3
-
4
3
  export declare const TranslationContext: import('react').Context<{
5
4
  currentLang: string;
6
5
  switchLanguage: (lang: string) => void;
@@ -1,6 +1,6 @@
1
- import { I as f, j as s } from "../jsx-runtime-BuVcKMXM.js";
1
+ import { I as f, j as s } from "../jsx-runtime-oIKL5WiM.js";
2
2
  import { useMemo as g, createElement as m, createContext as d, useState as i, useEffect as x } from "react";
3
- import "../crc32-DnIYX8GT.js";
3
+ import "../crc32-BeCcwohL.js";
4
4
  import { L } from "../constants-BypKaLtI.js";
5
5
  function p(t) {
6
6
  let {
@@ -1,6 +1,6 @@
1
1
  import { useContext as P, useState as $, useRef as w, useEffect as x } from "react";
2
- import { I as k, R as A } from "./jsx-runtime-BuVcKMXM.js";
3
- import { g as E, b as F } from "./i18nInstance-D20fwFYr.js";
2
+ import { I as k, R as A } from "./jsx-runtime-oIKL5WiM.js";
3
+ import { g as E, b as F } from "./i18nInstance-D3STmr24.js";
4
4
  function j() {
5
5
  if (console && console.warn) {
6
6
  for (var n = arguments.length, e = new Array(n), a = 0; a < n; a++)
@@ -69,7 +69,7 @@ function Y(n) {
69
69
  } = e, {
70
70
  i18n: f,
71
71
  defaultNS: o
72
- } = P(k) || {}, t = a || f || F();
72
+ } = P(k) || {}, t = a || f || E();
73
73
  if (t && !t.reportNamespaces && (t.reportNamespaces = new A()), !t) {
74
74
  I("You will need to pass in an i18next instance by using initReactI18next");
75
75
  const s = (c, i) => typeof i == "string" ? i : i && typeof i == "object" && typeof i.defaultValue == "string" ? i.defaultValue : Array.isArray(c) ? c[c.length - 1] : c, u = [s, {}, !1];
@@ -77,7 +77,7 @@ function Y(n) {
77
77
  }
78
78
  t.options.react && t.options.react.wait !== void 0 && I("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
79
79
  const g = {
80
- ...E(),
80
+ ...F(),
81
81
  ...t.options.react,
82
82
  ...e
83
83
  }, {
@@ -1,5 +1,4 @@
1
1
  import { InitOptions } from 'i18next';
2
-
3
2
  type TInstanceConfig = {
4
3
  useSuspense?: Exclude<InitOptions["react"], undefined>["useSuspense"];
5
4
  enableDebug?: InitOptions["debug"];
@@ -1,7 +1,7 @@
1
- import { i as a, c as o } from "../crc32-DnIYX8GT.js";
1
+ import { i as a, c as o } from "../crc32-BeCcwohL.js";
2
2
  import c from "./otasdk.js";
3
3
  import { getInitialLanguage as l } from "./lang-utils.js";
4
- import { s as u, a as f } from "../i18nInstance-D20fwFYr.js";
4
+ import { s as u, a as f } from "../i18nInstance-D3STmr24.js";
5
5
  const m = {
6
6
  type: "3rdParty",
7
7
  init(t) {
@@ -1,5 +1,4 @@
1
1
  import { constants } from './index';
2
-
3
2
  type LanguageCode = keyof typeof constants.ALL_LANGUAGES;
4
3
  export declare const getInitialLanguage: () => any;
5
4
  export declare const loadIncontextTranslation: (lang: LanguageCode) => void;
@@ -1,4 +1,4 @@
1
- import "../crc32-DnIYX8GT.js";
1
+ import "../crc32-BeCcwohL.js";
2
2
  import { L as s, D as c, A as o } from "../constants-BypKaLtI.js";
3
3
  const p = () => {
4
4
  const a = new URLSearchParams(window.location.search).get("lang");
@@ -1,10 +1,10 @@
1
- import { i as e, c as r } from "../crc32-DnIYX8GT.js";
2
- function o(t, a) {
3
- return t ? e.t(r.str(t).toString(), {
1
+ import { i as a, c as e } from "../crc32-BeCcwohL.js";
2
+ function c(t, r) {
3
+ return t ? a.t(e.str(t).toString(), {
4
4
  defaultValue: t,
5
- ...a
5
+ ...r
6
6
  }) : "";
7
7
  }
8
8
  export {
9
- o as default
9
+ c as default
10
10
  };
@@ -1,5 +1,4 @@
1
1
  import { ModuleType } from 'i18next';
2
-
3
2
  interface OtaI18nextModule {
4
3
  cdnUrl: string;
5
4
  type: ModuleType;
@@ -1,24 +1,21 @@
1
- var o = Object.defineProperty;
2
- var c = (n, t, e) => t in n ? o(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var s = (n, t, e) => c(n, typeof t != "symbol" ? t + "" : t, e);
4
- class h {
5
- constructor(t) {
6
- s(this, "type");
7
- s(this, "cdnUrl");
8
- this.type = "backend", this.cdnUrl = t;
1
+ class a {
2
+ type;
3
+ cdnUrl;
4
+ constructor(n) {
5
+ this.type = "backend", this.cdnUrl = n;
9
6
  }
10
- read(t, e, a) {
11
- fetch(this.cdnUrl + "/translations/" + t.toLowerCase() + ".json").then((r) => {
12
- if (!r.ok)
7
+ read(n, s, e) {
8
+ fetch(this.cdnUrl + "/translations/" + n.toLowerCase() + ".json").then((t) => {
9
+ if (!t.ok)
13
10
  throw new Error("Failed to fetch translations");
14
- return r.json();
15
- }).then((r) => {
16
- a(null, r);
11
+ return t.json();
12
+ }).then((t) => {
13
+ e(null, t);
17
14
  }).catch(() => {
18
- a(null, {});
15
+ e(null, {});
19
16
  });
20
17
  }
21
18
  }
22
19
  export {
23
- h as default
20
+ a as default
24
21
  };
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.11",
13
+ "version": "1.3.12",
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",
@@ -46,9 +46,9 @@
46
46
  "react-i18next": "^14.0.1",
47
47
  "semantic-release": "^23.0.6",
48
48
  "typescript": "^5.2.2",
49
- "vite": "^5.0.8",
50
- "vite-plugin-dts": "^3.7.3",
51
- "vitest": "^1.6.1"
49
+ "vite": "^7.0.5",
50
+ "vite-plugin-dts": "^4.5.4",
51
+ "vitest": "^3.2.4"
52
52
  },
53
53
  "optionalDependencies": {
54
54
  "@rollup/rollup-linux-x64-gnu": "^4.17.1"