@object-ui/i18n 4.0.7 → 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,7 @@ const zh = {
102
112
  pullToRefresh: '下拉刷新',
103
113
  refreshing: '刷新中…',
104
114
  openRecord: '打开记录',
105
- openMenu: '打开菜单',
115
+ openMenu: '更多操作',
106
116
  rowHeight: '行高: {{mode}}',
107
117
  empty: '空',
108
118
  yes: '是',
@@ -204,6 +214,18 @@ const zh = {
204
214
  deleteCard: '删除卡片',
205
215
  deleteColumn: '删除列',
206
216
  },
217
+ timeline: {
218
+ bucket: {
219
+ overdue: '已逾期',
220
+ today: '今天',
221
+ tomorrow: '明天',
222
+ thisWeek: '本周',
223
+ nextWeek: '下周',
224
+ later: '更晚',
225
+ noDate: '无日期',
226
+ unassigned: '未分配',
227
+ },
228
+ },
207
229
  view: {
208
230
  rename: '重命名',
209
231
  duplicateView: '复制视图',
@@ -227,14 +249,18 @@ const zh = {
227
249
  noViewsFound: '没有匹配的视图。',
228
250
  dragToReorder: '拖动排序',
229
251
  defaultView: '默认视图',
252
+ tabActionsFor: '{{name}} 的视图操作',
230
253
  },
231
254
  detail: {
232
255
  back: '返回',
233
256
  edit: '编辑',
234
- editInline: '内联编辑',
257
+ editInline: '编辑',
235
258
  save: '保存',
236
259
  saveChanges: '保存更改',
237
- editFieldsInline: '内联编辑字段',
260
+ editFieldsInline: '编辑字段',
261
+ cancel: '取消',
262
+ cancelEdit: '放弃更改',
263
+ openInNewTab: '在新标签页打开',
238
264
  share: '分享',
239
265
  duplicate: '复制',
240
266
  export: '导出',
@@ -266,6 +292,7 @@ const zh = {
266
292
  editRow: '编辑',
267
293
  deleteRow: '删除',
268
294
  deleteRowConfirmation: '确定要删除此记录吗?',
295
+ deleteRowTitle: '删除记录',
269
296
  actions: '操作',
270
297
  previousPage: '上一页',
271
298
  nextPage: '下一页',
@@ -342,6 +369,12 @@ const zh = {
342
369
  subscribeAriaLabel: '订阅通知',
343
370
  unsubscribeAriaLabel: '取消订阅通知',
344
371
  clearSearch: '清除搜索',
372
+ copyEmail: '复制邮箱',
373
+ copyPhone: '复制电话号码',
374
+ copyRecordId: '复制记录 ID',
375
+ showEmptyFields: '显示 {{count}} 个空字段',
376
+ hideEmptyFields: '隐藏空字段',
377
+ noValue: '无',
345
378
  },
346
379
  chart: {
347
380
  noData: '暂无图表数据',
@@ -420,6 +453,7 @@ const zh = {
420
453
  editLayout: '编辑布局',
421
454
  saveLayout: '保存布局',
422
455
  resetLayout: '重置布局',
456
+ total: '总计',
423
457
  },
424
458
  configPanel: {
425
459
  save: '保存',
@@ -728,6 +762,8 @@ const zh = {
728
762
  importedWithSkipped: '已导入 {{ok}} 行;跳过 {{skipped}} 行。',
729
763
  configureView: '配置视图',
730
764
  closePanel: '关闭面板',
765
+ showAdvancedSettings: '显示高级设置',
766
+ showFewerSettings: '显示精简设置',
731
767
  page: '页面',
732
768
  pageConfigHint: '工具栏、导航与视图外壳设置',
733
769
  listConfigHint: '此列表类型的数据渲染、列与外观',
@@ -780,6 +816,7 @@ const zh = {
780
816
  delete: '删除',
781
817
  deleteViewTitle: '删除视图',
782
818
  deleteViewConfirm: '确定要删除视图 "{{name}}" 吗?此操作无法撤销。',
819
+ bulkDeleteConfirm: '确定要删除选中的 {{count}} 条记录吗?此操作无法撤销。',
783
820
  duplicateViewName: '已存在同名视图。',
784
821
  viewTypeGrid: '表格',
785
822
  viewTypeGridDesc: '电子表格风格的记录表格。',
@@ -800,14 +837,36 @@ const zh = {
800
837
  newView: '新视图',
801
838
  typeOptions: '类型选项',
802
839
  groupByField: '分组字段',
840
+ groupByFieldHelp: '看板会按该字段的不同取值分列。',
803
841
  startDateField: '开始日期字段',
842
+ startDateFieldHelp: '日历将按该日期把记录放到对应日期格。',
843
+ ganttStartDateFieldHelp: '甘特条形图的左端使用该日期。',
844
+ ganttEndDateFieldHelp: '甘特条形图的右端使用该日期。',
845
+ timelineDateFieldHelp: '记录在时间轴上按该日期定位。',
804
846
  titleField: '标题字段',
805
847
  latitudeField: '纬度字段',
848
+ latitudeFieldHelp: '提供纬度坐标的字段(仅地理坐标字段可选)。',
806
849
  longitudeField: '经度字段',
850
+ longitudeFieldHelp: '提供经度坐标的字段(仅地理坐标字段可选)。',
807
851
  imageField: '图片字段',
852
+ imageFieldHelp: '画廊封面来自该图片或附件字段。',
808
853
  dateField: '日期字段',
809
854
  selectField: '选择字段...',
855
+ selectOption: '选择...',
810
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: '用于数值聚合的字段。',
811
870
  gridOptionsHint: '网格视图使用上方配置的列。',
812
871
  groupBy: '分组依据',
813
872
  prefixField: '前缀字段',
@@ -1098,7 +1157,7 @@ const zh = {
1098
1157
  ok: '确定',
1099
1158
  },
1100
1159
  rowAction: {
1101
- openMenu: '打开菜单',
1160
+ openMenu: '更多操作',
1102
1161
  edit: '编辑',
1103
1162
  delete: '删除',
1104
1163
  },
@@ -1119,6 +1178,8 @@ const zh = {
1119
1178
  deleteFailed: '删除 {{label}} 失败',
1120
1179
  noRecordId: '未提供记录 ID',
1121
1180
  deleteConfirm: '确定要删除此记录吗?',
1181
+ bulkDeleteSuccess: '已删除 {{count}} 条 {{label}} 记录',
1182
+ bulkDeletePartial: '成功 {{succeeded}} 条,失败 {{failed}} 条',
1122
1183
  },
1123
1184
  objectViewActions: {
1124
1185
  renameFailed: '重命名视图失败',
@@ -1138,5 +1199,10 @@ const zh = {
1138
1199
  no: '否',
1139
1200
  systemFields: '系统字段',
1140
1201
  },
1202
+ user: {
1203
+ profile: '个人资料',
1204
+ settings: '设置',
1205
+ logout: '注销',
1206
+ },
1141
1207
  };
1142
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.7",
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",