@arcblock/ux 2.4.34 → 2.4.35
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/lib/Locale/context.js +5 -3
- package/package.json +4 -4
- package/src/Locale/context.js +2 -2
package/lib/Locale/context.js
CHANGED
@@ -118,12 +118,14 @@ function LocaleProvider(_ref) {
|
|
118
118
|
|
119
119
|
const translate = (key, data) => {
|
120
120
|
if (!translations[currentLocale] || !translations[currentLocale][key]) {
|
121
|
+
var _translations$fallbac;
|
122
|
+
|
121
123
|
console.warn("Warning: no ".concat(key, " translation of ").concat(currentLocale));
|
122
124
|
|
123
|
-
if (fallbackLocale) {
|
124
|
-
var _translations$
|
125
|
+
if (fallbackLocale && (_translations$fallbac = translations[fallbackLocale]) !== null && _translations$fallbac !== void 0 && _translations$fallbac[key]) {
|
126
|
+
var _translations$fallbac2;
|
125
127
|
|
126
|
-
return ((_translations$
|
128
|
+
return replace((_translations$fallbac2 = translations[fallbackLocale]) === null || _translations$fallbac2 === void 0 ? void 0 : _translations$fallbac2[key], data);
|
127
129
|
}
|
128
130
|
|
129
131
|
return key;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.35",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"react": ">=18.1.0",
|
48
48
|
"react-ga": "^2.7.0"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "ab588afce5788da838553d067622aee14389f925",
|
51
51
|
"dependencies": {
|
52
|
-
"@arcblock/icons": "^2.4.
|
53
|
-
"@arcblock/react-hooks": "^2.4.
|
52
|
+
"@arcblock/icons": "^2.4.35",
|
53
|
+
"@arcblock/react-hooks": "^2.4.35",
|
54
54
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
55
55
|
"@emotion/react": "^11.10.0",
|
56
56
|
"@emotion/styled": "^11.10.0",
|
package/src/Locale/context.js
CHANGED
@@ -63,8 +63,8 @@ function LocaleProvider({ children, locale, fallbackLocale, translations, langua
|
|
63
63
|
const translate = (key, data) => {
|
64
64
|
if (!translations[currentLocale] || !translations[currentLocale][key]) {
|
65
65
|
console.warn(`Warning: no ${key} translation of ${currentLocale}`);
|
66
|
-
if (fallbackLocale) {
|
67
|
-
return translations[fallbackLocale]?.[key]
|
66
|
+
if (fallbackLocale && translations[fallbackLocale]?.[key]) {
|
67
|
+
return replace(translations[fallbackLocale]?.[key], data);
|
68
68
|
}
|
69
69
|
return key;
|
70
70
|
}
|