seeder-st2110-components 1.7.16 → 1.7.18

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.esm.js CHANGED
@@ -189,8 +189,8 @@ const getLocale = () => {
189
189
  return window.__COMPONENT_LOCALE__;
190
190
  }
191
191
  }
192
- // 默认语言:中文
193
- return 'zh-CN';
192
+ // 默认语言:英文(与 Umi 配置一致)
193
+ return 'en-US';
194
194
  };
195
195
 
196
196
  /**
@@ -278,18 +278,6 @@ const useIntl = () => {
278
278
  };
279
279
  };
280
280
 
281
- /**
282
- * 设置语言环境(可选)
283
- * 如果需要在运行时切换语言,可以调用此函数
284
- *
285
- * @param {string} locale - 语言代码,如 'zh-CN' 或 'en-US'
286
- */
287
- const setLocale = locale => {
288
- if (typeof window !== 'undefined') {
289
- window.__COMPONENT_LOCALE__ = locale;
290
- }
291
- };
292
-
293
281
  /**
294
282
  * 注册语言包(可选)
295
283
  * 如果需要在运行时注册语言包,可以调用此函数
@@ -306,64 +294,6 @@ const addMessages = (locale, messages) => {
306
294
  }
307
295
  };
308
296
 
309
- // 自动同步 Umi 语言配置(在组件库加载时执行)
310
- if (typeof window !== 'undefined') {
311
- // 尝试从 Umi 读取语言并同步到组件库
312
- const syncLocaleFromUmi = () => {
313
- var _window$g_initialProp5, _window$g_initialProp6;
314
- const umiLocale = window.g_lang || window.LOCALE || ((_window$g_initialProp5 = window.g_initialProps) === null || _window$g_initialProp5 === void 0 ? void 0 : _window$g_initialProp5.locale) || ((_window$g_initialProp6 = window.g_initialPropsFromServer) === null || _window$g_initialProp6 === void 0 ? void 0 : _window$g_initialProp6.locale) || localStorage.getItem('umi-locale');
315
- if (umiLocale && !window.__COMPONENT_LOCALE__) {
316
- window.__COMPONENT_LOCALE__ = umiLocale;
317
- console.log('[i18n] Synced locale from Umi:', umiLocale);
318
- }
319
- };
320
-
321
- // 立即同步
322
- syncLocaleFromUmi();
323
-
324
- // 监听 localStorage 变化(处理语言切换)
325
- window.addEventListener('storage', e => {
326
- if (e.key === 'umi-locale' && e.newValue) {
327
- window.__COMPONENT_LOCALE__ = e.newValue;
328
- console.log('[i18n] Locale changed via storage:', e.newValue);
329
- }
330
- });
331
- }
332
-
333
- /**
334
- * 初始化国际化
335
- * 在组件库初始化时调用,注册默认语言包
336
- */
337
- const initI18n = () => {
338
- // 注册中文语言包
339
- addMessages('zh-CN', {
340
- 'button.ok': '确定',
341
- 'button.cancel': '取消',
342
- 'button.save': '保存',
343
- 'button.delete': '删除',
344
- 'button.edit': '编辑',
345
- 'button.add': '添加',
346
- 'button.confirm': '确认',
347
- 'button.close': '关闭',
348
- 'button.apply': '应用'
349
- // ... 其他默认翻译
350
- });
351
-
352
- // 注册英文语言包
353
- addMessages('en-US', {
354
- 'button.ok': 'OK',
355
- 'button.cancel': 'Cancel',
356
- 'button.save': 'Save',
357
- 'button.delete': 'Delete',
358
- 'button.edit': 'Edit',
359
- 'button.add': 'Add',
360
- 'button.confirm': 'Confirm',
361
- 'button.close': 'Close',
362
- 'button.apply': 'Apply'
363
- // ... 其他默认翻译
364
- });
365
- };
366
-
367
297
  const formatBytes = function (bytes) {
368
298
  let decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
369
299
  if (bytes === 0 || !bytes || bytes < 0) return '0 Bytes';
@@ -14292,5 +14222,5 @@ const PayloadInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2$1({
14292
14222
  placeholder: "input.placeholder.enterPayload"
14293
14223
  }, props));
14294
14224
 
14295
- export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, MaintenancePage, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PayloadInput, PortInput, PresetModal, PtpModal$1 as PtpModal, StyledModal$3 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, addMessages, debugI18n, initI18n, enUS as localesEnUS, zhCN as localesZhCN, setLocale, useAuth, useHardwareUsage$1 as useHardwareUsage, useIntl, usePageReload$1 as usePageReload, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade, useWebSocketWithFeatures$1 as useWebSocketWithFeatures };
14225
+ export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, MaintenancePage, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PayloadInput, PortInput, PresetModal, PtpModal$1 as PtpModal, StyledModal$3 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, addMessages, debugI18n, enUS as localesEnUS, zhCN as localesZhCN, useAuth, useHardwareUsage$1 as useHardwareUsage, useIntl, usePageReload$1 as usePageReload, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade, useWebSocketWithFeatures$1 as useWebSocketWithFeatures };
14296
14226
  //# sourceMappingURL=index.esm.js.map