@arcblock/ux 2.4.34 → 2.4.36

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.
@@ -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$fallbac;
125
+ if (fallbackLocale && (_translations$fallbac = translations[fallbackLocale]) !== null && _translations$fallbac !== void 0 && _translations$fallbac[key]) {
126
+ var _translations$fallbac2;
125
127
 
126
- return ((_translations$fallbac = translations[fallbackLocale]) === null || _translations$fallbac === void 0 ? void 0 : _translations$fallbac[key]) || key;
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.34",
3
+ "version": "2.4.36",
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": "02c1622ae5619e5e15293111d2465e2d94a8e5ec",
50
+ "gitHead": "39718f263d0c1b1bf7e8ae93eaeabea45ada40c4",
51
51
  "dependencies": {
52
- "@arcblock/icons": "^2.4.34",
53
- "@arcblock/react-hooks": "^2.4.34",
52
+ "@arcblock/icons": "^2.4.36",
53
+ "@arcblock/react-hooks": "^2.4.36",
54
54
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
55
  "@emotion/react": "^11.10.0",
56
56
  "@emotion/styled": "^11.10.0",
@@ -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] || key;
66
+ if (fallbackLocale && translations[fallbackLocale]?.[key]) {
67
+ return replace(translations[fallbackLocale]?.[key], data);
68
68
  }
69
69
  return key;
70
70
  }