@object-ui/i18n 4.0.6 → 4.0.8

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.
@@ -34,6 +34,9 @@ const zh = {
34
34
  optional: '选填',
35
35
  selectOption: '请选择',
36
36
  select: '选择...',
37
+ openChat: '打开聊天',
38
+ closeChat: '关闭聊天',
39
+ toggleSidebar: '切换侧边栏',
37
40
  },
38
41
  validation: {
39
42
  required: '{{field}}不能为空',
@@ -60,7 +63,12 @@ const zh = {
60
63
  editTitle: '编辑{{object}}',
61
64
  createDescription: '向数据库添加新的{{object}}。',
62
65
  editDescription: '更新{{object}}的详情',
63
- saveRecord: '保存记录',
66
+ saveRecord: '保存',
67
+ create: '创建',
68
+ update: '更新',
69
+ createSuccess: '{{object}}创建成功',
70
+ updateSuccess: '{{object}}更新成功',
71
+ deleteSuccess: '{{object}}删除成功',
64
72
  },
65
73
  table: {
66
74
  rowsPerPage: '每页行数',
@@ -90,6 +98,8 @@ const zh = {
90
98
  search: '搜索...',
91
99
  modified: '{{count}} 行已修改',
92
100
  selected: '已选择 {{count}} 项',
101
+ edit: '编辑',
102
+ delete: '删除',
93
103
  },
94
104
  grid: {
95
105
  actions: '操作',
@@ -102,7 +112,58 @@ const zh = {
102
112
  pullToRefresh: '下拉刷新',
103
113
  refreshing: '刷新中…',
104
114
  openRecord: '打开记录',
115
+ openMenu: '更多操作',
105
116
  rowHeight: '行高: {{mode}}',
117
+ empty: '空',
118
+ yes: '是',
119
+ no: '否',
120
+ systemFields: '系统字段',
121
+ import: {
122
+ title: '导入{{object}}',
123
+ stepUpload: '上传',
124
+ stepMapping: '字段映射',
125
+ stepPreview: '预览',
126
+ uploadDescription: '上传 CSV 文件以开始导入。',
127
+ mappingDescription: '将 CSV 列映射到对象字段。',
128
+ previewDescription: '导入前预览数据。',
129
+ dragDrop: '拖拽 CSV 文件到此处,或点击选择文件',
130
+ browseFiles: '选择文件',
131
+ onlyCsv: '仅支持 CSV 文件。',
132
+ fileNeedsHeader: '文件必须包含表头行和至少一行数据。',
133
+ mappingTemplate: '映射模板:',
134
+ chooseTemplate: '选择模板…',
135
+ noSavedTemplates: '暂无保存的模板',
136
+ noneOption: '— 无 —',
137
+ saveCurrent: '保存当前映射',
138
+ templateName: '模板名称',
139
+ save: '保存',
140
+ deleteTemplate: '删除模板',
141
+ csvColumn: 'CSV 列',
142
+ mapsTo: '映射到',
143
+ status: '状态',
144
+ skipColumn: '跳过此列',
145
+ skip: '— 跳过 —',
146
+ mapped: '已映射',
147
+ skipped: '已跳过',
148
+ rowsWithErrors: '{{count}} 行有错误',
149
+ rowsCorrected: '已修正 {{count}} 行',
150
+ clickToFix: '— 点击高亮单元格可直接修改。',
151
+ showingRows: '显示第 {{shown}} 行,共 {{total}} 行',
152
+ importing: '导入中… {{progress}}%',
153
+ importComplete: '导入完成',
154
+ imported: '已导入 {{count}} 条',
155
+ skippedCount: '已跳过 {{count}} 条',
156
+ moreErrors: '…还有 {{count}} 个错误',
157
+ cancel: '取消',
158
+ back: '上一步',
159
+ next: '下一步',
160
+ close: '关闭',
161
+ importNRows: '导入 {{count}} 行',
162
+ importingProgress: '导入中…',
163
+ requiredMark: '*',
164
+ required: '必填',
165
+ invalidType: '{{type}} 格式无效',
166
+ },
106
167
  },
107
168
  calendar: {
108
169
  today: '今天',
@@ -153,6 +214,18 @@ const zh = {
153
214
  deleteCard: '删除卡片',
154
215
  deleteColumn: '删除列',
155
216
  },
217
+ timeline: {
218
+ bucket: {
219
+ overdue: '已逾期',
220
+ today: '今天',
221
+ tomorrow: '明天',
222
+ thisWeek: '本周',
223
+ nextWeek: '下周',
224
+ later: '更晚',
225
+ noDate: '无日期',
226
+ unassigned: '未分配',
227
+ },
228
+ },
156
229
  view: {
157
230
  rename: '重命名',
158
231
  duplicateView: '复制视图',
@@ -176,14 +249,18 @@ const zh = {
176
249
  noViewsFound: '没有匹配的视图。',
177
250
  dragToReorder: '拖动排序',
178
251
  defaultView: '默认视图',
252
+ tabActionsFor: '{{name}} 的视图操作',
179
253
  },
180
254
  detail: {
181
255
  back: '返回',
182
256
  edit: '编辑',
183
- editInline: '内联编辑',
257
+ editInline: '编辑',
184
258
  save: '保存',
185
259
  saveChanges: '保存更改',
186
- editFieldsInline: '内联编辑字段',
260
+ editFieldsInline: '编辑字段',
261
+ cancel: '取消',
262
+ cancelEdit: '放弃更改',
263
+ openInNewTab: '在新标签页打开',
187
264
  share: '分享',
188
265
  duplicate: '复制',
189
266
  export: '导出',
@@ -215,6 +292,7 @@ const zh = {
215
292
  editRow: '编辑',
216
293
  deleteRow: '删除',
217
294
  deleteRowConfirmation: '确定要删除此记录吗?',
295
+ deleteRowTitle: '删除记录',
218
296
  actions: '操作',
219
297
  previousPage: '上一页',
220
298
  nextPage: '下一页',
@@ -291,6 +369,12 @@ const zh = {
291
369
  subscribeAriaLabel: '订阅通知',
292
370
  unsubscribeAriaLabel: '取消订阅通知',
293
371
  clearSearch: '清除搜索',
372
+ copyEmail: '复制邮箱',
373
+ copyPhone: '复制电话号码',
374
+ copyRecordId: '复制记录 ID',
375
+ showEmptyFields: '显示 {{count}} 个空字段',
376
+ hideEmptyFields: '隐藏空字段',
377
+ noValue: '无',
294
378
  },
295
379
  chart: {
296
380
  noData: '暂无图表数据',
@@ -369,6 +453,7 @@ const zh = {
369
453
  editLayout: '编辑布局',
370
454
  saveLayout: '保存布局',
371
455
  resetLayout: '重置布局',
456
+ total: '总计',
372
457
  },
373
458
  configPanel: {
374
459
  save: '保存',
@@ -671,8 +756,14 @@ const zh = {
671
756
  addView: '添加视图',
672
757
  designTools: '设计工具',
673
758
  new: '新建',
759
+ import: '导入',
760
+ importTitle: '从 CSV 文件导入',
761
+ importedToast: '成功导入 {{count}} 行。',
762
+ importedWithSkipped: '已导入 {{ok}} 行;跳过 {{skipped}} 行。',
674
763
  configureView: '配置视图',
675
764
  closePanel: '关闭面板',
765
+ showAdvancedSettings: '显示高级设置',
766
+ showFewerSettings: '显示精简设置',
676
767
  page: '页面',
677
768
  pageConfigHint: '工具栏、导航与视图外壳设置',
678
769
  listConfigHint: '此列表类型的数据渲染、列与外观',
@@ -725,6 +816,7 @@ const zh = {
725
816
  delete: '删除',
726
817
  deleteViewTitle: '删除视图',
727
818
  deleteViewConfirm: '确定要删除视图 "{{name}}" 吗?此操作无法撤销。',
819
+ bulkDeleteConfirm: '确定要删除选中的 {{count}} 条记录吗?此操作无法撤销。',
728
820
  duplicateViewName: '已存在同名视图。',
729
821
  viewTypeGrid: '表格',
730
822
  viewTypeGridDesc: '电子表格风格的记录表格。',
@@ -745,14 +837,36 @@ const zh = {
745
837
  newView: '新视图',
746
838
  typeOptions: '类型选项',
747
839
  groupByField: '分组字段',
840
+ groupByFieldHelp: '看板会按该字段的不同取值分列。',
748
841
  startDateField: '开始日期字段',
842
+ startDateFieldHelp: '日历将按该日期把记录放到对应日期格。',
843
+ ganttStartDateFieldHelp: '甘特条形图的左端使用该日期。',
844
+ ganttEndDateFieldHelp: '甘特条形图的右端使用该日期。',
845
+ timelineDateFieldHelp: '记录在时间轴上按该日期定位。',
749
846
  titleField: '标题字段',
750
847
  latitudeField: '纬度字段',
848
+ latitudeFieldHelp: '提供纬度坐标的字段(仅地理坐标字段可选)。',
751
849
  longitudeField: '经度字段',
850
+ longitudeFieldHelp: '提供经度坐标的字段(仅地理坐标字段可选)。',
752
851
  imageField: '图片字段',
852
+ imageFieldHelp: '画廊封面来自该图片或附件字段。',
753
853
  dateField: '日期字段',
754
854
  selectField: '选择字段...',
855
+ selectOption: '选择...',
755
856
  noEligibleFieldForType: '没有符合条件的字段。请先在对象上添加该类型字段。',
857
+ viewTypeUnavailable: '该对象缺少所需的“{{field}}”字段。',
858
+ viewTypeUnavailableShort: '当前对象不支持。',
859
+ chartType: '图表类型',
860
+ chartTypeHelp: '决定数据如何呈现。',
861
+ chartTypeBar: '柱状图',
862
+ chartTypeLine: '折线图',
863
+ chartTypePie: '饼图',
864
+ chartTypeArea: '面积图',
865
+ chartTypeScatter: '散点图',
866
+ xAxisField: 'X 轴字段',
867
+ xAxisFieldHelp: '用于分类或时间维度的字段。',
868
+ yAxisField: 'Y 轴字段',
869
+ yAxisFieldHelp: '用于数值聚合的字段。',
756
870
  gridOptionsHint: '网格视图使用上方配置的列。',
757
871
  groupBy: '分组依据',
758
872
  prefixField: '前缀字段',
@@ -951,5 +1065,144 @@ const zh = {
951
1065
  default: '默认',
952
1066
  },
953
1067
  },
1068
+ layout: {
1069
+ appSwitcher: {
1070
+ home: '首页',
1071
+ addApp: '新增应用',
1072
+ editApp: '编辑应用',
1073
+ manageAllApps: '管理所有应用',
1074
+ systemConsole: '系统控制台',
1075
+ noAppsConfigured: '尚未配置任何应用',
1076
+ },
1077
+ activityFeed: {
1078
+ title: '最近动态',
1079
+ filter: '筛选',
1080
+ empty: '暂无最近动态',
1081
+ ariaLabel: '动态消息',
1082
+ typeCreate: '创建',
1083
+ typeUpdate: '更新',
1084
+ typeDelete: '删除',
1085
+ typeComment: '评论',
1086
+ relativeJustNow: '刚刚',
1087
+ relativeSecondsAgo: '{{count}} 秒前',
1088
+ relativeMinutesAgo: '{{count}} 分钟前',
1089
+ relativeHoursAgo: '{{count}} 小时前',
1090
+ relativeDaysAgo: '{{count}} 天前',
1091
+ },
1092
+ metadata: {
1093
+ label: '元数据',
1094
+ toggleTitle: '切换元数据检视器',
1095
+ panelTitle: '元数据检视器',
1096
+ jsonBadge: 'JSON',
1097
+ copyJson: '复制 JSON',
1098
+ },
1099
+ },
1100
+ search: {
1101
+ title: '搜索',
1102
+ back: '返回',
1103
+ placeholder: '搜索对象、仪表板、页面、报表…',
1104
+ inputAriaLabel: '搜索对象、仪表板、页面、报表',
1105
+ resultsCount: '找到 {{count}} 条与“{{query}}”相关的结果',
1106
+ resultsCountPlural: '找到 {{count}} 条与“{{query}}”相关的结果',
1107
+ itemsAvailable: '共 {{count}} 项可搜索',
1108
+ noResults: '未找到结果',
1109
+ noResultsHint: '请尝试调整搜索关键字',
1110
+ typeObjects: '对象',
1111
+ typeDashboards: '仪表板',
1112
+ typePages: '页面',
1113
+ typeReports: '报表',
1114
+ badgeObject: '对象',
1115
+ badgeDashboard: '仪表板',
1116
+ badgePage: '页面',
1117
+ badgeReport: '报表',
1118
+ },
1119
+ empty: {
1120
+ objectNotFound: '未找到对象',
1121
+ objectNotFoundDescription: '对象 “{{name}}” 的定义不存在。请检查配置或返回选择有效的对象。',
1122
+ pageNotFound: '未找到页面',
1123
+ pageNotFoundDescription: '未找到页面 “{{name}}”,可能已被删除或重命名。',
1124
+ dashboardNotFound: '未找到仪表板',
1125
+ dashboardNotFoundDescription: '未找到仪表板 “{{name}}”,可能已被删除或重命名。',
1126
+ reportNotFound: '未找到报表',
1127
+ reportNotFoundDescription: '未找到报表 “{{name}}”,可能已被删除或重命名。',
1128
+ noAppsConfigured: '尚未配置应用',
1129
+ noAppsConfiguredDescription: '当前没有任何已注册的应用。请创建您的第一个应用,或前往系统设置进行配置。',
1130
+ createFirstApp: '创建您的第一个应用',
1131
+ systemSettings: '系统设置',
1132
+ back: '返回',
1133
+ },
1134
+ renderer: {
1135
+ noPageSchema: '未提供页面 schema',
1136
+ noFormSchema: '未提供表单 schema',
1137
+ noDashboardSchema: '未提供仪表板 schema',
1138
+ pageRendering: '页面渲染中:{{name}}',
1139
+ dashboardRendering: '仪表板渲染中:{{name}}',
1140
+ formRenderingMode: '正在以 {{mode}} 模式渲染表单',
1141
+ formRenderingFor: '记录 {{id}}',
1142
+ createRecord: '新建记录',
1143
+ editRecord: '编辑记录',
1144
+ page: '页面',
1145
+ dashboard: '仪表板',
1146
+ save: '保存',
1147
+ cancel: '取消',
1148
+ },
1149
+ actionDialog: {
1150
+ title: '操作参数',
1151
+ description: '请填写以下信息以继续操作。',
1152
+ selectPlaceholder: '请选择 {{label}}',
1153
+ requiredError: '{{label}} 为必填项',
1154
+ cancel: '取消',
1155
+ confirm: '确认',
1156
+ defaultActionTitle: '操作',
1157
+ ok: '确定',
1158
+ },
1159
+ rowAction: {
1160
+ openMenu: '更多操作',
1161
+ edit: '编辑',
1162
+ delete: '删除',
1163
+ },
1164
+ navigationSync: {
1165
+ addedPage: '导航已更新:已添加页面 “{{name}}”',
1166
+ addedDashboard: '导航已更新:已添加仪表板 “{{name}}”',
1167
+ removedPage: '导航已更新:已移除页面 “{{name}}”',
1168
+ removedDashboard: '导航已更新:已移除仪表板 “{{name}}”',
1169
+ renamedPage: '导航已更新:页面 “{{oldName}}” 已重命名为 “{{newName}}”',
1170
+ renamedDashboard: '导航已更新:仪表板 “{{oldName}}” 已重命名为 “{{newName}}”',
1171
+ undoLabel: '撤销',
1172
+ undone: '已撤销导航变更',
1173
+ undoFailed: '撤销导航变更失败',
1174
+ updateFailed: '更新导航失败',
1175
+ },
1176
+ objectActions: {
1177
+ deleteSuccess: '{{label}} 删除成功',
1178
+ deleteFailed: '删除 {{label}} 失败',
1179
+ noRecordId: '未提供记录 ID',
1180
+ deleteConfirm: '确定要删除此记录吗?',
1181
+ bulkDeleteSuccess: '已删除 {{count}} 条 {{label}} 记录',
1182
+ bulkDeletePartial: '成功 {{succeeded}} 条,失败 {{failed}} 条',
1183
+ },
1184
+ objectViewActions: {
1185
+ renameFailed: '重命名视图失败',
1186
+ deleteFailed: '删除视图失败',
1187
+ },
1188
+ dashboardActions: {
1189
+ pdfPreparing: '正在准备 PDF 导出…',
1190
+ exportFailed: '导出失败:{{message}}',
1191
+ forecastSoon: '预测视图即将上线',
1192
+ },
1193
+ recordDetail: {
1194
+ viewersTooltip: '正在查看此记录的用户',
1195
+ },
1196
+ cellRender: {
1197
+ empty: '空',
1198
+ yes: '是',
1199
+ no: '否',
1200
+ systemFields: '系统字段',
1201
+ },
1202
+ user: {
1203
+ profile: '个人资料',
1204
+ settings: '设置',
1205
+ logout: '注销',
1206
+ },
954
1207
  };
955
1208
  export default zh;
@@ -149,6 +149,38 @@ export declare function useObjectLabel(): {
149
149
  name: string;
150
150
  label?: string;
151
151
  }) => string;
152
+ /**
153
+ * Resolve translated list-view label.
154
+ * Convention (per @objectstack/spec): `{ns}.objects.{objectName}._views.{viewName}.label`.
155
+ */
156
+ viewLabel: (objectName: string, viewName: string, fallback: string) => string;
157
+ /**
158
+ * Resolve translated list-view description.
159
+ * Convention: `{ns}.objects.{objectName}._views.{viewName}.description`.
160
+ */
161
+ viewDescription: (objectName: string, viewName: string, fallback?: string) => string | undefined;
162
+ /**
163
+ * Resolve translated form-section label.
164
+ * Convention: `{ns}.objects.{objectName}._sections.{sectionName}.label`.
165
+ */
166
+ sectionLabel: (objectName: string, sectionName: string, fallback: string) => string;
167
+ /**
168
+ * Resolve translated action label.
169
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.label`.
170
+ * Falls back to `{ns}.globalActions.{actionName}.label` when objectName is omitted.
171
+ */
172
+ actionLabel: (objectName: string | undefined, actionName: string, fallback: string) => string;
173
+ /**
174
+ * Resolve translated action confirmation prompt.
175
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.confirmText`.
176
+ * Returns undefined when no translation and no fallback exist.
177
+ */
178
+ actionConfirm: (objectName: string | undefined, actionName: string, fallback?: string) => string | undefined;
179
+ /**
180
+ * Resolve translated action success message.
181
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.successMessage`.
182
+ */
183
+ actionSuccess: (objectName: string | undefined, actionName: string, fallback?: string) => string | undefined;
152
184
  };
153
185
  /**
154
186
  * Safe wrapper for useObjectLabel that falls back to identity functions
@@ -167,4 +199,5 @@ export declare function useSafeFieldLabel(): {
167
199
  [key: string]: any;
168
200
  }>;
169
201
  fieldOptionLabel: (objectName: string, fieldName: string, optionValue: string, fallback: string) => string;
202
+ sectionLabel: (objectName: string, sectionName: string, fallback: string) => string;
170
203
  };
@@ -248,6 +248,61 @@ export function useObjectLabel() {
248
248
  * Convention: `{ns}.reports.{reportName}.label`.
249
249
  */
250
250
  reportLabel: (reportDef) => resolve(reportSuffixes(reportDef.name, 'label'), reportDef.label ?? reportDef.name),
251
+ /**
252
+ * Resolve translated list-view label.
253
+ * Convention (per @objectstack/spec): `{ns}.objects.{objectName}._views.{viewName}.label`.
254
+ */
255
+ viewLabel: (objectName, viewName, fallback) => resolve(objectSuffixes(objectName, `_views.${viewName}.label`), fallback),
256
+ /**
257
+ * Resolve translated list-view description.
258
+ * Convention: `{ns}.objects.{objectName}._views.{viewName}.description`.
259
+ */
260
+ viewDescription: (objectName, viewName, fallback) => {
261
+ const fb = fallback ?? '';
262
+ const resolved = resolve(objectSuffixes(objectName, `_views.${viewName}.description`), fb);
263
+ return resolved || undefined;
264
+ },
265
+ /**
266
+ * Resolve translated form-section label.
267
+ * Convention: `{ns}.objects.{objectName}._sections.{sectionName}.label`.
268
+ */
269
+ sectionLabel: (objectName, sectionName, fallback) => resolve(objectSuffixes(objectName, `_sections.${sectionName}.label`), fallback),
270
+ /**
271
+ * Resolve translated action label.
272
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.label`.
273
+ * Falls back to `{ns}.globalActions.{actionName}.label` when objectName is omitted.
274
+ */
275
+ actionLabel: (objectName, actionName, fallback) => {
276
+ if (objectName) {
277
+ return resolve(objectSuffixes(objectName, `_actions.${actionName}.label`), fallback);
278
+ }
279
+ return resolve(`globalActions.${actionName}.label`, fallback);
280
+ },
281
+ /**
282
+ * Resolve translated action confirmation prompt.
283
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.confirmText`.
284
+ * Returns undefined when no translation and no fallback exist.
285
+ */
286
+ actionConfirm: (objectName, actionName, fallback) => {
287
+ const fb = fallback ?? '';
288
+ const suffixes = objectName
289
+ ? objectSuffixes(objectName, `_actions.${actionName}.confirmText`)
290
+ : `globalActions.${actionName}.confirmText`;
291
+ const resolved = resolve(suffixes, fb);
292
+ return resolved || undefined;
293
+ },
294
+ /**
295
+ * Resolve translated action success message.
296
+ * Convention: `{ns}.objects.{objectName}._actions.{actionName}.successMessage`.
297
+ */
298
+ actionSuccess: (objectName, actionName, fallback) => {
299
+ const fb = fallback ?? '';
300
+ const suffixes = objectName
301
+ ? objectSuffixes(objectName, `_actions.${actionName}.successMessage`)
302
+ : `globalActions.${actionName}.successMessage`;
303
+ const resolved = resolve(suffixes, fb);
304
+ return resolved || undefined;
305
+ },
251
306
  };
252
307
  }
253
308
  /**
@@ -257,14 +312,15 @@ export function useObjectLabel() {
257
312
  */
258
313
  export function useSafeFieldLabel() {
259
314
  try {
260
- const { fieldLabel, translateOptions, fieldOptionLabel } = useObjectLabel();
261
- return { fieldLabel, translateOptions, fieldOptionLabel };
315
+ const { fieldLabel, translateOptions, fieldOptionLabel, sectionLabel } = useObjectLabel();
316
+ return { fieldLabel, translateOptions, fieldOptionLabel, sectionLabel };
262
317
  }
263
318
  catch {
264
319
  return {
265
320
  fieldLabel: (_objectName, _fieldName, fallback) => fallback,
266
321
  translateOptions: (_objectName, _fieldName, options) => options,
267
322
  fieldOptionLabel: (_objectName, _fieldName, _optionValue, fallback) => fallback,
323
+ sectionLabel: (_objectName, _sectionName, fallback) => fallback,
268
324
  };
269
325
  }
270
326
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/i18n",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -30,17 +30,17 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "i18next": "^26.0.8",
34
- "react-i18next": "^17.0.6"
33
+ "i18next": "^26.1.0",
34
+ "react-i18next": "^17.0.7"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.0.0 || ^19.0.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/react": "19.2.14",
41
- "react": "19.2.5",
41
+ "react": "19.2.6",
42
42
  "typescript": "^6.0.3",
43
- "vitest": "^4.1.5"
43
+ "vitest": "^4.1.6"
44
44
  },
45
45
  "keywords": [
46
46
  "objectui",