@vlian/framework 1.2.48 → 1.2.50

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,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.47
2
+ * @vlian/framework v1.2.49
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.47
2
+ * @vlian/framework v1.2.49
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
@@ -73,6 +73,7 @@
73
73
  }
74
74
  };
75
75
 
76
+ let setupPromise = null;
76
77
  /** Setup plugin i18n */ function setupI18n(otherLocales = {
77
78
  'en-US': {},
78
79
  'zh-CN': {}
@@ -85,13 +86,23 @@
85
86
  translation: Object.assign({}, local, otherLocales['zh-CN'])
86
87
  }
87
88
  };
88
- i18n.use(reactI18next.initReactI18next).init({
89
+ if (i18n.isInitialized) {
90
+ i18n.addResourceBundle('en-US', 'translation', locales['en-US'].translation, true, true);
91
+ i18n.addResourceBundle('zh-CN', 'translation', locales['zh-CN'].translation, true, true);
92
+ return Promise.resolve(i18n);
93
+ }
94
+ if (setupPromise) {
95
+ return setupPromise;
96
+ }
97
+ const initPromise = i18n.use(reactI18next.initReactI18next).init({
89
98
  interpolation: {
90
99
  escapeValue: false
91
100
  },
92
101
  lng: 'zh-CN',
93
102
  resources: locales
94
- });
103
+ }).then(()=>i18n);
104
+ setupPromise = initPromise;
105
+ return initPromise;
95
106
  }
96
107
  const $t = i18n.t;
97
108
  function setLang(locale) {
@@ -12499,6 +12510,7 @@
12499
12510
  async setTheme(nextTheme) {
12500
12511
  const prev = this.theme;
12501
12512
  this.theme = {
12513
+ ...this.theme,
12502
12514
  ...nextTheme
12503
12515
  };
12504
12516
  applyThemeToDocument(this.theme);
@@ -12549,7 +12561,7 @@
12549
12561
  } else {
12550
12562
  await writePersistedValue(this.config.persistence, JSON.stringify(this.snapshot));
12551
12563
  }
12552
- setupI18n(this.snapshot.resources || {});
12564
+ await setupI18n(this.snapshot.resources || {});
12553
12565
  setLang(this.snapshot.locale);
12554
12566
  }
12555
12567
  getSnapshot() {