@object-ui/i18n 13.1.0 → 14.0.0

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.
@@ -254,6 +254,7 @@ declare const zh: {
254
254
  };
255
255
  readonly downloadTemplate: "下载模板";
256
256
  readonly downloadTemplateHint: "获取带正确列的 CSV(必填字段标 *)。";
257
+ readonly templateFileName: "{{object}}-导入模板";
257
258
  readonly validate: "校验数据";
258
259
  readonly validateHint: "导入前在服务端逐行校验。";
259
260
  readonly validating: "校验中…";
@@ -397,6 +398,10 @@ declare const zh: {
397
398
  readonly title: "暂无用户";
398
399
  readonly message: "用户账号由认证提供方预置,无法在此处手动创建。邀请团队成员加入你的组织,他们首次登录时会自动出现(SSO 即时预置)。应用的终端用户会在通过你的应用注册时出现。";
399
400
  };
401
+ readonly betterAuthTeam: {
402
+ readonly title: "暂无团队";
403
+ readonly message: "团队用于在组织内对成员分组。可用「创建团队」新建,或通过认证提供方的组织与 SSO 预置流程自动出现。";
404
+ };
400
405
  };
401
406
  readonly showAll: "显示全部";
402
407
  readonly pullToRefresh: "下拉刷新";
@@ -414,6 +419,28 @@ declare const zh: {
414
419
  readonly inlineEditLabel: "行内编辑记录(点击单元格进行编辑)";
415
420
  readonly recordEditingTitle: "记录编辑";
416
421
  };
422
+ readonly managedByBadge: {
423
+ readonly config: {
424
+ readonly short: "管理配置";
425
+ readonly title: "管理员配置";
426
+ readonly body: "这些记录定义平台的运行时行为。请在此处编写配置;其产生的运行时数据存放在单独的表中。";
427
+ };
428
+ readonly system: {
429
+ readonly short: "系统管理";
430
+ readonly title: "由平台管理";
431
+ readonly body: "当源记录上的操作运行时,这里的行会自动创建。下方列表是只读监控界面——行级操作(批准、撤回、重发等)在每一行上。";
432
+ };
433
+ readonly appendOnly: {
434
+ readonly short: "只读 · 审计日志";
435
+ readonly title: "只读历史记录";
436
+ readonly body: "不可变审计日志。行由平台在事件发生时写入,不能在界面上创建、编辑或删除。可使用导出功能下载以供合规审查。";
437
+ };
438
+ readonly betterAuth: {
439
+ readonly short: "身份";
440
+ readonly title: "由身份提供方管理";
441
+ readonly body: "此对象的架构由 {{provider}} 管理。直接编辑会绕过密码哈希、会话校验、两步验证检查和审计钩子。请通过身份认证提供方的登录、邀请和安全流程管理这些记录。";
442
+ };
443
+ };
417
444
  readonly kanban: {
418
445
  readonly addCard: "添加卡片";
419
446
  readonly addColumn: "添加列";
@@ -473,7 +500,7 @@ declare const zh: {
473
500
  readonly row: {
474
501
  readonly expand: "展开";
475
502
  readonly collapse: "收起";
476
- readonly locate: "在甘特图上定位";
503
+ readonly open: "打开详情";
477
504
  };
478
505
  readonly aria: {
479
506
  readonly taskList: "任务列表";
@@ -489,6 +516,25 @@ declare const zh: {
489
516
  readonly addSuccessor: "添加后置任务…";
490
517
  readonly removeDependency: "移除依赖";
491
518
  readonly noCandidates: "无可用任务";
519
+ readonly searchTasks: "搜索任务…";
520
+ readonly qrcode: "移动端二维码";
521
+ };
522
+ readonly qr: {
523
+ readonly title: "在手机上打开";
524
+ readonly hint: "用手机扫码打开详情页";
525
+ readonly copy: "复制链接";
526
+ readonly copied: "已复制";
527
+ readonly close: "关闭";
528
+ };
529
+ readonly delete: {
530
+ readonly title: "删除此任务?";
531
+ readonly body: "\"{{title}}\" 将被永久删除,此操作无法撤销。";
532
+ readonly cancel: "取消";
533
+ readonly confirm: "删除";
534
+ readonly deleting: "删除中…";
535
+ };
536
+ readonly drawer: {
537
+ readonly fallbackTitle: "任务详情";
492
538
  };
493
539
  readonly linkType: {
494
540
  readonly fs: "完成 → 开始";
@@ -510,6 +556,8 @@ declare const zh: {
510
556
  };
511
557
  readonly readOnly: "只读";
512
558
  readonly readOnlyHint: "此视图已禁用编辑。";
559
+ readonly lockedHint: "无编辑权限";
560
+ readonly writeFailed: "保存失败,已恢复修改前状态";
513
561
  };
514
562
  readonly view: {
515
563
  readonly editViewConfig: "编辑视图配置";
@@ -553,6 +601,7 @@ declare const zh: {
553
601
  readonly saveChanges: "保存更改";
554
602
  readonly saving: "保存中…";
555
603
  readonly editFieldsInline: "编辑字段";
604
+ readonly editInlineHint: "双击编辑";
556
605
  readonly lockedByApproval: "审批中已锁定";
557
606
  readonly lockedTooltip: "该记录有待审批的请求,编辑已被锁定";
558
607
  readonly cancelApproval: "撤回审批";
@@ -1260,6 +1309,7 @@ declare const zh: {
1260
1309
  readonly seedWarn: "已发布,但部分示例数据未能载入。";
1261
1310
  readonly openBuiltApp: "打开应用";
1262
1311
  readonly previewDraft: "预览";
1312
+ readonly previewApp: "预览应用";
1263
1313
  readonly resizeSplit: "调整对话与预览的宽度";
1264
1314
  readonly hideChats: "隐藏对话列表";
1265
1315
  readonly showChats: "显示对话列表";
@@ -1322,6 +1372,22 @@ declare const zh: {
1322
1372
  readonly noAccessTitle: "无访问权限";
1323
1373
  readonly noAccess: "您没有权限查看此数据。";
1324
1374
  };
1375
+ readonly identityImport: {
1376
+ readonly policyTitle: "导入用户的登录方式";
1377
+ readonly policy: {
1378
+ readonly none: "不设密码(推荐)";
1379
+ readonly invite: "发送邀请";
1380
+ readonly temporary: "临时密码";
1381
+ };
1382
+ readonly policyHint: {
1383
+ readonly none: "用户通过手机验证码、魔法链接或重置链接首次登录,之后自行设置密码。";
1384
+ readonly invite: "为每个新建用户发送\"设置密码\"邮件(仅手机号的行发送邀请短信)。需要已配置邮件/短信服务。";
1385
+ readonly temporary: "适用于未配置邮件/短信的部署:为每个新建用户生成一次性密码,仅在结果页显示一次,首次登录强制修改。";
1386
+ };
1387
+ readonly passwordsNote: "临时密码——仅显示一次,不会被保存。请立即保存;用户首次登录时必须修改。";
1388
+ readonly passwordsMore: "更多条目已省略——请使用下载。";
1389
+ readonly passwordsDownload: "下载 CSV";
1390
+ };
1325
1391
  readonly objectView: {
1326
1392
  readonly systemViewReadonly: "系统视图由代码定义,只读。";
1327
1393
  readonly expandToPage: "以完整页面打开";
@@ -1550,6 +1616,7 @@ declare const zh: {
1550
1616
  readonly errors: {
1551
1617
  readonly invalidCredentials: "邮箱或密码错误,请重试。";
1552
1618
  readonly emailNotVerified: "请先验证您的邮箱后再登录。";
1619
+ readonly oauthCallbackFailed: "单点登录未能完成——登录链接已过期或已被使用,请重新发起登录。";
1553
1620
  };
1554
1621
  };
1555
1622
  readonly register: {
@@ -1688,6 +1755,43 @@ declare const zh: {
1688
1755
  readonly tenantHostHint: "您正在登录此工作区";
1689
1756
  };
1690
1757
  };
1758
+ readonly profile: {
1759
+ readonly title: "个人资料";
1760
+ readonly subtitle: "管理您的账户设置";
1761
+ readonly saving: "保存中…";
1762
+ readonly avatar: {
1763
+ readonly upload: "上传";
1764
+ readonly replace: "更换";
1765
+ readonly remove: "移除";
1766
+ };
1767
+ readonly info: {
1768
+ readonly title: "个人信息";
1769
+ readonly description: "更新您的姓名并查看账户详情";
1770
+ readonly saved: "个人资料已更新。";
1771
+ readonly name: "姓名";
1772
+ readonly email: "邮箱";
1773
+ readonly emailImmutable: "邮箱不可修改。";
1774
+ readonly role: "角色";
1775
+ readonly save: "保存更改";
1776
+ };
1777
+ readonly password: {
1778
+ readonly changeTitle: "修改密码";
1779
+ readonly setTitle: "设置本地密码";
1780
+ readonly changeDescription: "更新您在此环境登录所用的密码。";
1781
+ readonly setDescription: "您通过单点登录进入。设置本地密码后,也可以在此环境使用邮箱和密码登录。";
1782
+ readonly current: "当前密码";
1783
+ readonly new: "新密码";
1784
+ readonly password: "密码";
1785
+ readonly confirm: "确认密码";
1786
+ readonly tooShort: "密码长度至少为 8 个字符";
1787
+ readonly mismatch: "两次输入的密码不一致";
1788
+ readonly enterCurrent: "请输入当前密码";
1789
+ readonly changed: "密码已修改。";
1790
+ readonly localSet: "本地密码已设置。现在您可以在此环境使用邮箱和密码登录。";
1791
+ readonly changeAction: "修改密码";
1792
+ readonly setAction: "设置密码";
1793
+ };
1794
+ };
1691
1795
  readonly errors: {
1692
1796
  readonly networkError: "网络错误,请检查网络连接。";
1693
1797
  readonly serverError: "服务器错误,请稍后重试。";
@@ -2012,6 +2116,8 @@ declare const zh: {
2012
2116
  readonly deleteFailed: "删除 {{label}} 失败";
2013
2117
  readonly noRecordId: "未提供记录 ID";
2014
2118
  readonly deleteConfirm: "确定要删除此记录吗?";
2119
+ readonly resetPackageSetConfirm: "该权限集随已安装的软件包发布,无法删除。删除操作将丢弃环境定制并把它重置为发布基线。是否继续?";
2120
+ readonly resetPackageSetSuccess: "权限集已重置为发布基线";
2015
2121
  readonly bulkDeleteSuccess: "已删除 {{count}} 条 {{label}} 记录";
2016
2122
  readonly bulkDeletePartial: "成功 {{succeeded}} 条,失败 {{failed}} 条";
2017
2123
  };
@@ -256,6 +256,7 @@ const zh = {
256
256
  // 下载模板
257
257
  downloadTemplate: '下载模板',
258
258
  downloadTemplateHint: '获取带正确列的 CSV(必填字段标 *)。',
259
+ templateFileName: '{{object}}-导入模板',
259
260
  // 校验(服务端 dryRun 预检)
260
261
  validate: '校验数据',
261
262
  validateHint: '导入前在服务端逐行校验。',
@@ -406,6 +407,10 @@ const zh = {
406
407
  title: '暂无用户',
407
408
  message: '用户账号由认证提供方预置,无法在此处手动创建。邀请团队成员加入你的组织,他们首次登录时会自动出现(SSO 即时预置)。应用的终端用户会在通过你的应用注册时出现。',
408
409
  },
410
+ betterAuthTeam: {
411
+ title: '暂无团队',
412
+ message: '团队用于在组织内对成员分组。可用「创建团队」新建,或通过认证提供方的组织与 SSO 预置流程自动出现。',
413
+ },
409
414
  },
410
415
  showAll: '显示全部',
411
416
  pullToRefresh: '下拉刷新',
@@ -423,6 +428,28 @@ const zh = {
423
428
  inlineEditLabel: '行内编辑记录(点击单元格进行编辑)',
424
429
  recordEditingTitle: '记录编辑',
425
430
  },
431
+ managedByBadge: {
432
+ config: {
433
+ short: '管理配置',
434
+ title: '管理员配置',
435
+ body: '这些记录定义平台的运行时行为。请在此处编写配置;其产生的运行时数据存放在单独的表中。',
436
+ },
437
+ system: {
438
+ short: '系统管理',
439
+ title: '由平台管理',
440
+ body: '当源记录上的操作运行时,这里的行会自动创建。下方列表是只读监控界面——行级操作(批准、撤回、重发等)在每一行上。',
441
+ },
442
+ appendOnly: {
443
+ short: '只读 · 审计日志',
444
+ title: '只读历史记录',
445
+ body: '不可变审计日志。行由平台在事件发生时写入,不能在界面上创建、编辑或删除。可使用导出功能下载以供合规审查。',
446
+ },
447
+ betterAuth: {
448
+ short: '身份',
449
+ title: '由身份提供方管理',
450
+ body: '此对象的架构由 {{provider}} 管理。直接编辑会绕过密码哈希、会话校验、两步验证检查和审计钩子。请通过身份认证提供方的登录、邀请和安全流程管理这些记录。',
451
+ },
452
+ },
426
453
  kanban: {
427
454
  addCard: '添加卡片',
428
455
  addColumn: '添加列',
@@ -482,7 +509,7 @@ const zh = {
482
509
  row: {
483
510
  expand: '展开',
484
511
  collapse: '收起',
485
- locate: '在甘特图上定位',
512
+ open: '打开详情',
486
513
  },
487
514
  aria: {
488
515
  taskList: '任务列表',
@@ -498,6 +525,25 @@ const zh = {
498
525
  addSuccessor: '添加后置任务…',
499
526
  removeDependency: '移除依赖',
500
527
  noCandidates: '无可用任务',
528
+ searchTasks: '搜索任务…',
529
+ qrcode: '移动端二维码',
530
+ },
531
+ qr: {
532
+ title: '在手机上打开',
533
+ hint: '用手机扫码打开详情页',
534
+ copy: '复制链接',
535
+ copied: '已复制',
536
+ close: '关闭',
537
+ },
538
+ delete: {
539
+ title: '删除此任务?',
540
+ body: '"{{title}}" 将被永久删除,此操作无法撤销。',
541
+ cancel: '取消',
542
+ confirm: '删除',
543
+ deleting: '删除中…',
544
+ },
545
+ drawer: {
546
+ fallbackTitle: '任务详情',
501
547
  },
502
548
  linkType: {
503
549
  fs: '完成 → 开始',
@@ -519,6 +565,8 @@ const zh = {
519
565
  },
520
566
  readOnly: '只读',
521
567
  readOnlyHint: '此视图已禁用编辑。',
568
+ lockedHint: '无编辑权限',
569
+ writeFailed: '保存失败,已恢复修改前状态',
522
570
  },
523
571
  view: {
524
572
  editViewConfig: '编辑视图配置',
@@ -562,6 +610,7 @@ const zh = {
562
610
  saveChanges: '保存更改',
563
611
  saving: '保存中…',
564
612
  editFieldsInline: '编辑字段',
613
+ editInlineHint: '双击编辑',
565
614
  lockedByApproval: '审批中已锁定',
566
615
  lockedTooltip: '该记录有待审批的请求,编辑已被锁定',
567
616
  cancelApproval: '撤回审批',
@@ -1284,6 +1333,7 @@ const zh = {
1284
1333
  seedWarn: '已发布,但部分示例数据未能载入。',
1285
1334
  openBuiltApp: '打开应用',
1286
1335
  previewDraft: '预览',
1336
+ previewApp: '预览应用',
1287
1337
  resizeSplit: '调整对话与预览的宽度',
1288
1338
  hideChats: '隐藏对话列表',
1289
1339
  showChats: '显示对话列表',
@@ -1352,6 +1402,22 @@ const zh = {
1352
1402
  noAccessTitle: '无访问权限',
1353
1403
  noAccess: '您没有权限查看此数据。',
1354
1404
  },
1405
+ identityImport: {
1406
+ policyTitle: '导入用户的登录方式',
1407
+ policy: {
1408
+ none: '不设密码(推荐)',
1409
+ invite: '发送邀请',
1410
+ temporary: '临时密码',
1411
+ },
1412
+ policyHint: {
1413
+ none: '用户通过手机验证码、魔法链接或重置链接首次登录,之后自行设置密码。',
1414
+ invite: '为每个新建用户发送"设置密码"邮件(仅手机号的行发送邀请短信)。需要已配置邮件/短信服务。',
1415
+ temporary: '适用于未配置邮件/短信的部署:为每个新建用户生成一次性密码,仅在结果页显示一次,首次登录强制修改。',
1416
+ },
1417
+ passwordsNote: '临时密码——仅显示一次,不会被保存。请立即保存;用户首次登录时必须修改。',
1418
+ passwordsMore: '更多条目已省略——请使用下载。',
1419
+ passwordsDownload: '下载 CSV',
1420
+ },
1355
1421
  objectView: {
1356
1422
  systemViewReadonly: '系统视图由代码定义,只读。',
1357
1423
  expandToPage: '以完整页面打开',
@@ -1580,6 +1646,7 @@ const zh = {
1580
1646
  errors: {
1581
1647
  invalidCredentials: '邮箱或密码错误,请重试。',
1582
1648
  emailNotVerified: '请先验证您的邮箱后再登录。',
1649
+ oauthCallbackFailed: '单点登录未能完成——登录链接已过期或已被使用,请重新发起登录。',
1583
1650
  },
1584
1651
  },
1585
1652
  register: {
@@ -1718,6 +1785,43 @@ const zh = {
1718
1785
  tenantHostHint: '您正在登录此工作区',
1719
1786
  },
1720
1787
  },
1788
+ profile: {
1789
+ title: '个人资料',
1790
+ subtitle: '管理您的账户设置',
1791
+ saving: '保存中…',
1792
+ avatar: {
1793
+ upload: '上传',
1794
+ replace: '更换',
1795
+ remove: '移除',
1796
+ },
1797
+ info: {
1798
+ title: '个人信息',
1799
+ description: '更新您的姓名并查看账户详情',
1800
+ saved: '个人资料已更新。',
1801
+ name: '姓名',
1802
+ email: '邮箱',
1803
+ emailImmutable: '邮箱不可修改。',
1804
+ role: '角色',
1805
+ save: '保存更改',
1806
+ },
1807
+ password: {
1808
+ changeTitle: '修改密码',
1809
+ setTitle: '设置本地密码',
1810
+ changeDescription: '更新您在此环境登录所用的密码。',
1811
+ setDescription: '您通过单点登录进入。设置本地密码后,也可以在此环境使用邮箱和密码登录。',
1812
+ current: '当前密码',
1813
+ new: '新密码',
1814
+ password: '密码',
1815
+ confirm: '确认密码',
1816
+ tooShort: '密码长度至少为 8 个字符',
1817
+ mismatch: '两次输入的密码不一致',
1818
+ enterCurrent: '请输入当前密码',
1819
+ changed: '密码已修改。',
1820
+ localSet: '本地密码已设置。现在您可以在此环境使用邮箱和密码登录。',
1821
+ changeAction: '修改密码',
1822
+ setAction: '设置密码',
1823
+ },
1824
+ },
1721
1825
  errors: {
1722
1826
  networkError: '网络错误,请检查网络连接。',
1723
1827
  serverError: '服务器错误,请稍后重试。',
@@ -2045,6 +2149,8 @@ const zh = {
2045
2149
  deleteFailed: '删除 {{label}} 失败',
2046
2150
  noRecordId: '未提供记录 ID',
2047
2151
  deleteConfirm: '确定要删除此记录吗?',
2152
+ resetPackageSetConfirm: '该权限集随已安装的软件包发布,无法删除。删除操作将丢弃环境定制并把它重置为发布基线。是否继续?',
2153
+ resetPackageSetSuccess: '权限集已重置为发布基线',
2048
2154
  bulkDeleteSuccess: '已删除 {{count}} 条 {{label}} 记录',
2049
2155
  bulkDeletePartial: '成功 {{succeeded}} 条,失败 {{failed}} 条',
2050
2156
  },
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Accepts a plain string (passed through) or an i18n object keyed by language
5
5
  * code — e.g. `{ en: 'Pricing', 'zh-CN': '定价', zh: '定价', default: 'Pricing' }`.
6
- * Resolution order: exact language -> base language (`zh-CN` -> `zh`) -> `default`
7
- * -> `en` -> first value. Unlike a `default`/`en`-only resolver this is genuinely
6
+ * Resolution order: exact language -> base language (`zh-CN` -> `zh`) -> any
7
+ * region-qualified key sharing the base (`zh` -> `zh-CN`) -> `default` -> `en`
8
+ * -> first value. Unlike a `default`/`en`-only resolver this is genuinely
8
9
  * locale-aware, so server-driven metadata (page text, action param labels) can
9
10
  * carry inline translations instead of rendering "[object Object]" or English.
10
11
  *
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Accepts a plain string (passed through) or an i18n object keyed by language
5
5
  * code — e.g. `{ en: 'Pricing', 'zh-CN': '定价', zh: '定价', default: 'Pricing' }`.
6
- * Resolution order: exact language -> base language (`zh-CN` -> `zh`) -> `default`
7
- * -> `en` -> first value. Unlike a `default`/`en`-only resolver this is genuinely
6
+ * Resolution order: exact language -> base language (`zh-CN` -> `zh`) -> any
7
+ * region-qualified key sharing the base (`zh` -> `zh-CN`) -> `default` -> `en`
8
+ * -> first value. Unlike a `default`/`en`-only resolver this is genuinely
8
9
  * locale-aware, so server-driven metadata (page text, action param labels) can
9
10
  * carry inline translations instead of rendering "[object Object]" or English.
10
11
  *
@@ -22,8 +23,12 @@ export function pickLocalized(value, language) {
22
23
  const o = value;
23
24
  const lang = (language || 'en').trim();
24
25
  const base = lang.split('-')[0];
26
+ // Runtime language is often a bare base code ('zh') while metadata authors
27
+ // write full BCP-47 tags ('zh-CN') — upgrade to any key sharing the base.
28
+ const regional = Object.keys(o).find((k) => k.split('-')[0] === base && typeof o[k] === 'string');
25
29
  const pick = o[lang] ??
26
30
  o[base] ??
31
+ (regional !== undefined ? o[regional] : undefined) ??
27
32
  o.default ??
28
33
  o.en ??
29
34
  Object.values(o).find((v) => typeof v === 'string');
@@ -236,4 +236,5 @@ export declare function useSafeFieldLabel(): {
236
236
  }[];
237
237
  fieldOptionLabel: (_objectName: string, _fieldName: string, _optionValue: string, fallback: string) => string;
238
238
  sectionLabel: (_objectName: string, _sectionName: string, fallback: string) => string;
239
+ actionLabel: (_objectName: string | undefined, _actionName: string, fallback: string) => string;
239
240
  };
@@ -394,6 +394,7 @@ const SAFE_FIELD_LABEL_FALLBACK = {
394
394
  translateOptions: (_objectName, _fieldName, options) => options,
395
395
  fieldOptionLabel: (_objectName, _fieldName, _optionValue, fallback) => fallback,
396
396
  sectionLabel: (_objectName, _sectionName, fallback) => fallback,
397
+ actionLabel: (_objectName, _actionName, fallback) => fallback,
397
398
  };
398
399
  /**
399
400
  * Safe wrapper for useObjectLabel that falls back to identity functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/i18n",
3
- "version": "13.1.0",
3
+ "version": "14.0.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -30,8 +30,8 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "i18next": "^26.3.4",
34
- "react-i18next": "^17.0.8"
33
+ "i18next": "^26.3.6",
34
+ "react-i18next": "^17.0.9"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.0.0 || ^19.0.0"