@nerimity/solid-i18lite 1.6.1 → 1.7.1
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/browser.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const [n, e] =
|
|
1
|
+
import { createComponent as y, memo as d } from "solid-js/web";
|
|
2
|
+
import { useContext as x, createContext as C, createSignal as T, children as w } from "solid-js";
|
|
3
|
+
import E from "@nerimity/i18lite";
|
|
4
|
+
const h = C();
|
|
5
|
+
function I(t, r) {
|
|
6
|
+
const [n, e] = T(r.resources ? t.t : () => null);
|
|
7
7
|
t.on("loaded", () => e(() => t.t)), t.init(r, (a, i) => e(() => i));
|
|
8
8
|
async function c(a) {
|
|
9
9
|
const i = await t.changeLanguage(a);
|
|
10
10
|
e(() => i);
|
|
11
11
|
}
|
|
12
|
-
function o(a, i,
|
|
13
|
-
return t.addResourceBundle(a, i,
|
|
12
|
+
function o(a, i, m, u = {}) {
|
|
13
|
+
return t.addResourceBundle(a, i, m, u.deep, u.overwrite);
|
|
14
14
|
}
|
|
15
15
|
return [((...a) => n().apply(null, a)), {
|
|
16
16
|
addResources: o,
|
|
@@ -18,9 +18,9 @@ function w(t, r) {
|
|
|
18
18
|
changeLanguage: c
|
|
19
19
|
}];
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const v = () => x(h), N = (t) => y(h.Provider, {
|
|
22
22
|
get value() {
|
|
23
|
-
return
|
|
23
|
+
return I(t.instance || E, {
|
|
24
24
|
lng: t.lng,
|
|
25
25
|
...t.options
|
|
26
26
|
});
|
|
@@ -28,12 +28,17 @@ const I = () => m(g), N = (t) => f(g.Provider, {
|
|
|
28
28
|
get children() {
|
|
29
29
|
return t.children;
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
31
|
+
}), g = document.createElement("textarea");
|
|
32
|
+
function f(t) {
|
|
33
|
+
return g.innerHTML = t || "", g.value;
|
|
34
|
+
}
|
|
35
|
+
const l = (t, { prefix: r, suffix: n }) => t.includes(r) && t.includes(n), L = (t, { interpolation: r }) => (n, e) => typeof n == "string" ? l(n, r) ? f(t.children[e].children?.[0].content) : t.children[e].content : (n.textContent = t.children[e].children?.[0].content, n), S = !globalThis.window, k = (t, r, n) => (e) => {
|
|
32
36
|
const c = typeof e;
|
|
33
|
-
if (c === "string" && l(e, r.interpolation))
|
|
37
|
+
if (c === "string" && l(e, r.interpolation))
|
|
38
|
+
return f(t(e, n.options));
|
|
34
39
|
if (c === "object") {
|
|
35
40
|
const o = e.textContent ?? e.t;
|
|
36
|
-
o && l(o, r.interpolation) && (e[
|
|
41
|
+
o && l(o, r.interpolation) && (e[S ? "t" : "textContent"] = t(o, n.options));
|
|
37
42
|
}
|
|
38
43
|
return e;
|
|
39
44
|
};
|
|
@@ -44,7 +49,7 @@ let s;
|
|
|
44
49
|
} catch {
|
|
45
50
|
}
|
|
46
51
|
})();
|
|
47
|
-
const
|
|
52
|
+
const H = () => {
|
|
48
53
|
console.error(
|
|
49
54
|
"In order to use JSX nesting, install %chtml-parse-string",
|
|
50
55
|
"font-weight: 700",
|
|
@@ -53,30 +58,30 @@ const L = () => {
|
|
|
53
58
|
}, P = ({ i18n: { options: t }, t: r, props: n }, e) => {
|
|
54
59
|
const c = r(n.key, n.options);
|
|
55
60
|
if (!n.children) return c;
|
|
56
|
-
if (c === n.key) return e.map(
|
|
61
|
+
if (c === n.key) return e.map(k(r, t, n));
|
|
57
62
|
if (!s) {
|
|
58
|
-
|
|
63
|
+
H();
|
|
59
64
|
return;
|
|
60
65
|
}
|
|
61
66
|
try {
|
|
62
67
|
const [o] = s(`<0>${c}</0>`);
|
|
63
|
-
return e.map(
|
|
68
|
+
return e.map(L(o, t));
|
|
64
69
|
} catch (o) {
|
|
65
70
|
console.error(o);
|
|
66
71
|
}
|
|
67
72
|
}, R = (t) => {
|
|
68
73
|
const [r, {
|
|
69
74
|
getI18next: n
|
|
70
|
-
}] =
|
|
75
|
+
}] = v();
|
|
71
76
|
return d(() => d(() => typeof t.children == "string")() ? r(t.key, t.children, t.options) : P({
|
|
72
77
|
i18n: n(),
|
|
73
78
|
t: r,
|
|
74
79
|
props: t
|
|
75
|
-
},
|
|
80
|
+
}, w(() => t.children)()));
|
|
76
81
|
};
|
|
77
82
|
export {
|
|
78
83
|
R as Trans,
|
|
79
84
|
N as TransProvider,
|
|
80
|
-
|
|
85
|
+
v as useTransContext
|
|
81
86
|
};
|
|
82
87
|
//# sourceMappingURL=browser.mjs.map
|
package/dist/browser.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","sources":["../src/TransProvider.tsx","../src/utils/has-interpolation.ts","../src/utils/replace-elements.ts","../src/utils/translate-with-interpolation.ts","../src/utils/translate-jsx.ts","../src/Trans.tsx"],"sourcesContent":["import i18next, { type InitOptions, type TFunction, type i18n } from '@nerimity/i18lite';\r\nimport { createContext, createSignal, useContext, type ParentComponent } from 'solid-js';\r\n\r\nexport type TransProviderActions = {\r\n addResources(lng: string, ns: string, resources: any): i18n;\r\n changeLanguage(lng: string): Promise<void>;\r\n getI18next(): i18n;\r\n};\r\n\r\nconst TransContext = createContext<[TFunction, TransProviderActions]>();\r\n\r\nfunction createTransContext(instance: i18n, options: InitOptions): [TFunction, TransProviderActions] {\r\n const [translate, setTranslate] = createSignal<TFunction | (() => null)>(\r\n !!options.resources ? instance.t : () => null\r\n );\r\n\r\n instance.on('loaded', () => setTranslate(() => instance.t));\r\n instance.init(options, (_, t) => setTranslate(() => t));\r\n\r\n async function changeLanguage(lng: string) {\r\n const t = await instance.changeLanguage(lng);\r\n setTranslate(() => t);\r\n }\r\n\r\n function addResources(\r\n lng: string,\r\n ns: string,\r\n resources: any,\r\n bundleOptions: { deep?: boolean; overwrite?: boolean } = {}\r\n ): i18n {\r\n return instance.addResourceBundle(lng, ns, resources, bundleOptions.deep, bundleOptions.overwrite);\r\n }\r\n\r\n return [\r\n ((...args: Parameters<TFunction>) => translate().apply(null, args)) as TFunction,\r\n {\r\n addResources,\r\n getI18next: () => instance,\r\n changeLanguage,\r\n },\r\n ];\r\n}\r\n\r\nexport const useTransContext = () => useContext(TransContext);\r\n\r\nexport const TransProvider: ParentComponent<{ instance?: i18n; lng?: string; options?: InitOptions }> = (props) => {\r\n return (\r\n <TransContext.Provider\r\n value={createTransContext(props.instance || i18next, { lng: props.lng, ...props.options })}\r\n children={props.children}\r\n />\r\n );\r\n};\r\n","import type { InterpolationOptions } from '@nerimity/i18lite';\r\n\r\nexport const hasInterpolation = (value: string, { prefix, suffix }: InterpolationOptions) =>\r\n value.includes(prefix) && value.includes(suffix);\r\n","import type { InitOptions } from '@nerimity/i18lite';\r\nimport type { IDom } from 'html-parse-string';\r\nimport { hasInterpolation } from './has-interpolation';\r\n\r\nexport const replaceElements =\r\n (ast: IDom, { interpolation }: InitOptions) =>\r\n (child: Node, index: number) => {\r\n if (typeof child === 'string') {\r\n if (hasInterpolation(child, interpolation)) return ast.children[index].children?.[0].content;\r\n\r\n return ast.children[index].content;\r\n }\r\n\r\n child.textContent = ast.children[index].children?.[0].content;\r\n\r\n return child;\r\n };\r\n","import type { InitOptions, TFunction } from '@nerimity/i18lite';\r\nimport type { TransProps } from '../Trans';\r\nimport { hasInterpolation } from './has-interpolation';\r\n\r\nconst isNode = !globalThis.window;\r\n\r\nexport const translateWithInterpolation = (t: TFunction, options: InitOptions, props: TransProps) => (item) => {\r\n const type = typeof item;\r\n\r\n if (type === 'string' && hasInterpolation(item, options.interpolation)) return t(item, props.options);\r\n\r\n if (type === 'object') {\r\n const textContent = item.textContent ?? item.t;\r\n if (textContent && hasInterpolation(textContent, options.interpolation)) {\r\n item[isNode ? 't' : 'textContent'] = t(textContent, props.options);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n","import type { TFunction, i18n } from '@nerimity/i18lite';\r\nimport type { parse } from 'html-parse-string';\r\nimport type { ParentProps } from 'solid-js';\r\nimport type { TransProps } from '../Trans';\r\nimport { replaceElements } from './replace-elements';\r\nimport { translateWithInterpolation } from './translate-with-interpolation';\r\n\r\nexport let parseHTML: typeof parse;\r\n\r\n(async () => {\r\n try {\r\n // @ts-ignore\r\n const module = await import('html-parse-string');\r\n parseHTML = module.parse;\r\n } catch {}\r\n})();\r\n\r\nconst htmlParseStringNotFoundError = () => {\r\n console.error(\r\n 'In order to use JSX nesting, install %chtml-parse-string',\r\n 'font-weight: 700',\r\n 'https://github.com/ryansolid/html-parse-string.'\r\n );\r\n};\r\nexport const translateJSX = (\r\n { i18n: { options }, t, props }: { t: TFunction; props: ParentProps<TransProps>; i18n: i18n },\r\n children: Node[]\r\n) => {\r\n const translation = t(props.key, props.options);\r\n\r\n if (!props.children) return translation;\r\n\r\n if (translation === props.key) return children.map(translateWithInterpolation(t, options, props));\r\n\r\n if (!parseHTML) {\r\n htmlParseStringNotFoundError();\r\n return;\r\n }\r\n try {\r\n const [ast] = parseHTML(`<0>${translation}</0>`);\r\n return children.map(replaceElements(ast, options));\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n};\r\n","import type { TOptions } from '@nerimity/i18lite';\r\nimport { children, type ParentComponent } from 'solid-js';\r\nimport { useTransContext } from './TransProvider';\r\nimport { translateJSX } from './utils/translate-jsx';\r\n\r\nexport type TransProps = { key: string; options?: TOptions };\r\n\r\nexport const Trans: ParentComponent<TransProps> = (props) => {\r\n const [t, { getI18next }] = useTransContext();\r\n\r\n return (\r\n <>\r\n {typeof props.children === 'string'\r\n ? t(props.key, props.children, props.options)\r\n : translateJSX({ i18n: getI18next(), t, props }, children(() => props.children)() as Node[])}\r\n </>\r\n );\r\n};\r\n"],"names":["TransContext","createContext","createTransContext","instance","options","translate","setTranslate","createSignal","resources","t","on","init","_","changeLanguage","lng","addResources","ns","bundleOptions","addResourceBundle","deep","overwrite","args","apply","getI18next","useTransContext","useContext","TransProvider","props","_$createComponent","Provider","value","i18next","children","hasInterpolation","prefix","suffix","replaceElements","ast","interpolation","child","index","isNode","translateWithInterpolation","item","type","textContent","parseHTML","htmlParseStringNotFoundError","translateJSX","translation","e","Trans","_$memo","key","i18n"],"mappings":";;;AASA,MAAMA,IAAeC,EAAAA;AAErB,SAASC,EAAmBC,GAAgBC,GAAyD;AACnG,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAC9BH,EAAQI,YAAYL,EAASM,IAAI,MAAM,IAC3C;AAEAN,EAAAA,EAASO,GAAG,UAAU,MAAMJ,EAAa,MAAMH,EAASM,CAAC,CAAC,GAC1DN,EAASQ,KAAKP,GAAS,CAACQ,GAAGH,MAAMH,EAAa,MAAMG,CAAC,CAAC;AAEtD,iBAAeI,EAAeC,GAAa;AACzC,UAAML,IAAI,MAAMN,EAASU,eAAeC,CAAG;AAC3CR,IAAAA,EAAa,MAAMG,CAAC;AAAA,EACtB;AAEA,WAASM,EACPD,GACAE,GACAR,GACAS,IAAyD,CAAA,GACnD;AACN,WAAOd,EAASe,kBAAkBJ,GAAKE,GAAIR,GAAWS,EAAcE,MAAMF,EAAcG,SAAS;AAAA,EACnG;AAEA,SAAO,EACJ,IAAIC,MAAgChB,EAAAA,EAAYiB,MAAM,MAAMD,CAAI,IACjE;AAAA,IACEN,cAAAA;AAAAA,IACAQ,YAAYA,MAAMpB;AAAAA,IAClBU,gBAAAA;AAAAA,EAAAA,CACD;AAEL;AAEO,MAAMW,IAAkBA,MAAMC,EAAWzB,CAAY,GAE/C0B,IAA4FC,CAAAA,MACvGC,EACG5B,EAAa6B,UAAQ;AAAA,EAAA,IACpBC,QAAK;AAAA,WAAE5B,EAAmByB,EAAMxB,YAAY4B,GAAS;AAAA,MAAEjB,KAAKa,EAAMb;AAAAA,MAAK,GAAGa,EAAMvB;AAAAA,IAAAA,CAAS;AAAA,EAAC;AAAA,EAAA,IAC1F4B,WAAQ;AAAA,WAAEL,EAAMK;AAAAA,EAAQ;AAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"browser.mjs","sources":["../src/TransProvider.tsx","../src/utils/decodeHtmlEntities.ts","../src/utils/has-interpolation.ts","../src/utils/replace-elements.ts","../src/utils/translate-with-interpolation.ts","../src/utils/translate-jsx.ts","../src/Trans.tsx"],"sourcesContent":["import i18next, { type InitOptions, type TFunction, type i18n } from '@nerimity/i18lite';\r\nimport { createContext, createSignal, useContext, type ParentComponent } from 'solid-js';\r\n\r\nexport type TransProviderActions = {\r\n addResources(lng: string, ns: string, resources: any): i18n;\r\n changeLanguage(lng: string): Promise<void>;\r\n getI18next(): i18n;\r\n};\r\n\r\nconst TransContext = createContext<[TFunction, TransProviderActions]>();\r\n\r\nfunction createTransContext(instance: i18n, options: InitOptions): [TFunction, TransProviderActions] {\r\n const [translate, setTranslate] = createSignal<TFunction | (() => null)>(\r\n !!options.resources ? instance.t : () => null\r\n );\r\n\r\n instance.on('loaded', () => setTranslate(() => instance.t));\r\n instance.init(options, (_, t) => setTranslate(() => t));\r\n\r\n async function changeLanguage(lng: string) {\r\n const t = await instance.changeLanguage(lng);\r\n setTranslate(() => t);\r\n }\r\n\r\n function addResources(\r\n lng: string,\r\n ns: string,\r\n resources: any,\r\n bundleOptions: { deep?: boolean; overwrite?: boolean } = {}\r\n ): i18n {\r\n return instance.addResourceBundle(lng, ns, resources, bundleOptions.deep, bundleOptions.overwrite);\r\n }\r\n\r\n return [\r\n ((...args: Parameters<TFunction>) => translate().apply(null, args)) as TFunction,\r\n {\r\n addResources,\r\n getI18next: () => instance,\r\n changeLanguage,\r\n },\r\n ];\r\n}\r\n\r\nexport const useTransContext = () => useContext(TransContext);\r\n\r\nexport const TransProvider: ParentComponent<{ instance?: i18n; lng?: string; options?: InitOptions }> = (props) => {\r\n return (\r\n <TransContext.Provider\r\n value={createTransContext(props.instance || i18next, { lng: props.lng, ...props.options })}\r\n children={props.children}\r\n />\r\n );\r\n};\r\n","const tempElement = document.createElement('textarea');\r\nexport function decodeHtmlEntities(encodedText: string) {\r\n tempElement.innerHTML = encodedText || '';\r\n\r\n return tempElement.value;\r\n}\r\n","import type { InterpolationOptions } from '@nerimity/i18lite';\r\n\r\nexport const hasInterpolation = (value: string, { prefix, suffix }: InterpolationOptions) =>\r\n value.includes(prefix) && value.includes(suffix);\r\n","import type { InitOptions } from '@nerimity/i18lite';\r\nimport type { IDom } from 'html-parse-string';\r\nimport { decodeHtmlEntities } from './decodeHtmlEntities';\r\nimport { hasInterpolation } from './has-interpolation';\r\n\r\nexport const replaceElements =\r\n (ast: IDom, { interpolation }: InitOptions) =>\r\n (child: Node, index: number) => {\r\n if (typeof child === 'string') {\r\n if (hasInterpolation(child, interpolation)) return decodeHtmlEntities(ast.children[index].children?.[0].content);\r\n\r\n return ast.children[index].content;\r\n }\r\n\r\n child.textContent = ast.children[index].children?.[0].content;\r\n\r\n return child;\r\n };\r\n","import type { InitOptions, TFunction } from '@nerimity/i18lite';\r\nimport type { TransProps } from '../Trans';\r\nimport { decodeHtmlEntities } from './decodeHtmlEntities';\r\nimport { hasInterpolation } from './has-interpolation';\r\n\r\nconst isNode = !globalThis.window;\r\n\r\nexport const translateWithInterpolation = (t: TFunction, options: InitOptions, props: TransProps) => (item) => {\r\n const type = typeof item;\r\n\r\n if (type === 'string' && hasInterpolation(item, options.interpolation)) {\r\n return decodeHtmlEntities(t(item, props.options));\r\n }\r\n\r\n if (type === 'object') {\r\n const textContent = item.textContent ?? item.t;\r\n if (textContent && hasInterpolation(textContent, options.interpolation)) {\r\n item[isNode ? 't' : 'textContent'] = t(textContent, props.options);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n","import type { TFunction, i18n } from '@nerimity/i18lite';\r\nimport type { parse } from 'html-parse-string';\r\nimport type { ParentProps } from 'solid-js';\r\nimport type { TransProps } from '../Trans';\r\nimport { replaceElements } from './replace-elements';\r\nimport { translateWithInterpolation } from './translate-with-interpolation';\r\n\r\nexport let parseHTML: typeof parse;\r\n\r\n(async () => {\r\n try {\r\n // @ts-ignore\r\n const module = await import('html-parse-string');\r\n parseHTML = module.parse;\r\n } catch {}\r\n})();\r\n\r\nconst htmlParseStringNotFoundError = () => {\r\n console.error(\r\n 'In order to use JSX nesting, install %chtml-parse-string',\r\n 'font-weight: 700',\r\n 'https://github.com/ryansolid/html-parse-string.'\r\n );\r\n};\r\nexport const translateJSX = (\r\n { i18n: { options }, t, props }: { t: TFunction; props: ParentProps<TransProps>; i18n: i18n },\r\n children: Node[]\r\n) => {\r\n const translation = t(props.key, props.options);\r\n\r\n if (!props.children) return translation;\r\n\r\n if (translation === props.key) return children.map(translateWithInterpolation(t, options, props));\r\n\r\n if (!parseHTML) {\r\n htmlParseStringNotFoundError();\r\n return;\r\n }\r\n try {\r\n const [ast] = parseHTML(`<0>${translation}</0>`);\r\n return children.map(replaceElements(ast, options));\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n};\r\n","import type { TOptions } from '@nerimity/i18lite';\r\nimport { children, type ParentComponent } from 'solid-js';\r\nimport { useTransContext } from './TransProvider';\r\nimport { translateJSX } from './utils/translate-jsx';\r\n\r\nexport type TransProps = { key: string; options?: TOptions };\r\n\r\nexport const Trans: ParentComponent<TransProps> = (props) => {\r\n const [t, { getI18next }] = useTransContext();\r\n\r\n return (\r\n <>\r\n {typeof props.children === 'string'\r\n ? t(props.key, props.children, props.options)\r\n : translateJSX({ i18n: getI18next(), t, props }, children(() => props.children)() as Node[])}\r\n </>\r\n );\r\n};\r\n"],"names":["TransContext","createContext","createTransContext","instance","options","translate","setTranslate","createSignal","resources","t","on","init","_","changeLanguage","lng","addResources","ns","bundleOptions","addResourceBundle","deep","overwrite","args","apply","getI18next","useTransContext","useContext","TransProvider","props","_$createComponent","Provider","value","i18next","children","tempElement","decodeHtmlEntities","encodedText","hasInterpolation","prefix","suffix","replaceElements","ast","interpolation","child","index","isNode","translateWithInterpolation","item","type","textContent","parseHTML","htmlParseStringNotFoundError","translateJSX","translation","e","Trans","_$memo","key","i18n"],"mappings":";;;AASA,MAAMA,IAAeC,EAAA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,GAAGL,GAASuB,CAAK,CAAC;AAEhG,MAAI,CAACsB,GAAW;AACd,IAAAC,EAAA;AACA;AAAA,EACF;AACA,MAAI;AACF,UAAM,CAACV,CAAG,IAAIS,EAAU,MAAMG,CAAW,MAAM;AAC/C,WAAOpB,EAAS,IAAIO,EAAgBC,GAAKpC,CAAO,CAAC;AAAA,EACnD,SAASiD,GAAG;AACV,YAAQ,MAAMA,CAAC;AAAA,EACjB;AACF,GCrCaC,IAAsC3B,CAAAA,MAAU;AAC3D,QAAM,CAAClB,GAAG;AAAA,IAAEc,YAAAA;AAAAA,EAAAA,CAAY,IAAIC,EAAAA;AAE5B,SAAA+B,EAAA,MAEKA,EAAA,MAAA,OAAO5B,EAAMK,YAAa,QAAQ,EAAA,IAC/BvB,EAAEkB,EAAM6B,KAAK7B,EAAMK,UAAUL,EAAMvB,OAAO,IAC1C+C,EAAa;AAAA,IAAEM,MAAMlC,EAAAA;AAAAA,IAAcd,GAAAA;AAAAA,IAAGkB,OAAAA;AAAAA,EAAAA,GAASK,EAAS,MAAML,EAAMK,QAAQ,EAAA,CAAa,CAAC;AAGpG;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function decodeHtmlEntities(encodedText: string): string;
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "1.7.1",
|
|
2
3
|
"author": "SupertigerDev",
|
|
3
4
|
"description": "i18next for SolidJS",
|
|
4
5
|
"devDependencies": {
|
|
@@ -71,6 +72,5 @@
|
|
|
71
72
|
},
|
|
72
73
|
"sideEffects": false,
|
|
73
74
|
"type": "module",
|
|
74
|
-
"types": "./dist/types/index.d.ts"
|
|
75
|
-
"version": "1.6.1"
|
|
75
|
+
"types": "./dist/types/index.d.ts"
|
|
76
76
|
}
|