@sheet-i18n/react-client 1.0.6 → 1.0.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/index.js +8 -0
- package/dist/index.mjs +8 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -57,14 +57,22 @@ function IntlProvider({
|
|
|
57
57
|
}) {
|
|
58
58
|
var _a;
|
|
59
59
|
const locale = (_a = currentLocale != null ? currentLocale : detectClientLanguage(i18nStore)) != null ? _a : i18nStore.defaultLocale;
|
|
60
|
+
i18nStore.setCurrentLocale(locale);
|
|
60
61
|
(0, import_react.useEffect)(() => {
|
|
61
62
|
i18nStore.setCurrentLocale(locale);
|
|
62
63
|
}, [locale]);
|
|
64
|
+
const onError = (err) => {
|
|
65
|
+
const typeSafe = i18nStore.typeSafe;
|
|
66
|
+
if (typeSafe) {
|
|
67
|
+
console.error(err);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
63
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
71
|
import_react_intl.IntlProvider,
|
|
65
72
|
{
|
|
66
73
|
locale,
|
|
67
74
|
messages: i18nStore == null ? void 0 : i18nStore.localeSet[locale],
|
|
75
|
+
onError,
|
|
68
76
|
children
|
|
69
77
|
}
|
|
70
78
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -34,14 +34,22 @@ function IntlProvider({
|
|
|
34
34
|
}) {
|
|
35
35
|
var _a;
|
|
36
36
|
const locale = (_a = currentLocale != null ? currentLocale : detectClientLanguage(i18nStore)) != null ? _a : i18nStore.defaultLocale;
|
|
37
|
+
i18nStore.setCurrentLocale(locale);
|
|
37
38
|
useEffect(() => {
|
|
38
39
|
i18nStore.setCurrentLocale(locale);
|
|
39
40
|
}, [locale]);
|
|
41
|
+
const onError = (err) => {
|
|
42
|
+
const typeSafe = i18nStore.typeSafe;
|
|
43
|
+
if (typeSafe) {
|
|
44
|
+
console.error(err);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
40
47
|
return /* @__PURE__ */ jsx(
|
|
41
48
|
ReactIntlProvider,
|
|
42
49
|
{
|
|
43
50
|
locale,
|
|
44
51
|
messages: i18nStore == null ? void 0 : i18nStore.localeSet[locale],
|
|
52
|
+
onError,
|
|
45
53
|
children
|
|
46
54
|
}
|
|
47
55
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheet-i18n/react-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "a client package for react modules used by sheet-i18n",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-intl": "^7.0.4",
|
|
30
|
-
"@sheet-i18n/
|
|
31
|
-
"@sheet-i18n/
|
|
32
|
-
"@sheet-i18n/errors": "1.3.
|
|
30
|
+
"@sheet-i18n/shared-utils": "1.3.7",
|
|
31
|
+
"@sheet-i18n/react-core": "1.0.5",
|
|
32
|
+
"@sheet-i18n/errors": "1.3.7"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/react": "^19.0.2",
|
|
36
36
|
"@types/react-dom": "^19.0.2",
|
|
37
|
-
"@sheet-i18n/typescript-config": "1.3.
|
|
37
|
+
"@sheet-i18n/typescript-config": "1.3.7"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsup",
|