@bpmn-nova/studio 0.3.9-preview → 0.4.1

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.
Files changed (79) hide show
  1. package/README.md +2 -2
  2. package/dist/canvas.js +97 -25
  3. package/dist/config.js +13 -0
  4. package/dist/context-menu.js +41 -32
  5. package/dist/controller.js +45 -19
  6. package/dist/flow-tree.d.ts +4 -0
  7. package/dist/flow-tree.js +14 -0
  8. package/dist/index.d.ts +47 -2
  9. package/dist/index.js +1 -0
  10. package/dist/interactions.js +6 -1
  11. package/dist/modules/bpmn-model/index.d.ts +2 -1
  12. package/dist/modules/bpmn-model/index.js +12 -10
  13. package/dist/modules/core/gateway.js +16 -13
  14. package/dist/modules/core/index.d.ts +6 -4
  15. package/dist/modules/core/model.js +12 -7
  16. package/dist/modules/designer/index.d.ts +5 -1
  17. package/dist/modules/designer/index.js +36 -15
  18. package/dist/modules/export-svg/index.d.ts +12 -5
  19. package/dist/modules/export-svg/preview.js +34 -24
  20. package/dist/modules/export-svg/render.js +102 -50
  21. package/dist/modules/flow-tree/controller.js +364 -0
  22. package/dist/modules/flow-tree/index.d.ts +248 -0
  23. package/dist/modules/flow-tree/index.js +5 -0
  24. package/dist/modules/flow-tree/operations.js +484 -0
  25. package/dist/modules/flow-tree/sample.js +445 -0
  26. package/dist/modules/flow-tree/schema.js +588 -0
  27. package/dist/modules/flow-tree/validate.js +125 -0
  28. package/dist/modules/flow-tree-bpmn/compiler.js +547 -0
  29. package/dist/modules/flow-tree-bpmn/decompiler.js +524 -0
  30. package/dist/modules/flow-tree-bpmn/expression.js +135 -0
  31. package/dist/modules/flow-tree-bpmn/index.d.ts +53 -0
  32. package/dist/modules/flow-tree-bpmn/index.js +14 -0
  33. package/dist/modules/flow-tree-renderer/canvas.js +1003 -0
  34. package/dist/modules/flow-tree-renderer/export-svg.js +325 -0
  35. package/dist/modules/flow-tree-renderer/index.d.ts +143 -0
  36. package/dist/modules/flow-tree-renderer/index.js +3 -0
  37. package/dist/modules/flow-tree-renderer/shell.js +970 -0
  38. package/dist/modules/i18n/index.d.ts +647 -0
  39. package/dist/modules/i18n/index.js +247 -0
  40. package/dist/modules/i18n/locales/en-US.js +1222 -0
  41. package/dist/modules/i18n/locales/zh-CN.js +1204 -0
  42. package/dist/modules/icons/index.js +23 -0
  43. package/dist/modules/node-presentation/index.d.ts +3 -2
  44. package/dist/modules/node-presentation/index.js +14 -11
  45. package/dist/modules/palette/index.d.ts +6 -1
  46. package/dist/modules/palette/index.js +26 -8
  47. package/dist/modules/palette/panel.js +44 -6
  48. package/dist/modules/properties/index.d.ts +2 -1
  49. package/dist/modules/properties/index.js +2 -2
  50. package/dist/modules/properties-activiti/index.js +84 -59
  51. package/dist/modules/properties-bpmn/index.js +151 -128
  52. package/dist/modules/properties-core/index.d.ts +9 -3
  53. package/dist/modules/properties-core/index.js +16 -4
  54. package/dist/modules/properties-flow-tree/index.d.ts +56 -0
  55. package/dist/modules/properties-flow-tree/index.js +2 -0
  56. package/dist/modules/properties-flow-tree/panel.js +1136 -0
  57. package/dist/modules/properties-flow-tree/widgets.js +625 -0
  58. package/dist/modules/properties-flowable/index.js +55 -34
  59. package/dist/modules/properties-renderer/index.d.ts +5 -1
  60. package/dist/modules/properties-renderer/index.js +110 -42
  61. package/dist/modules/renderer-svg/index.d.ts +6 -2
  62. package/dist/modules/renderer-svg/index.js +113 -38
  63. package/dist/modules/runtime/index.d.ts +33 -5
  64. package/dist/modules/runtime/index.js +97 -73
  65. package/dist/modules/runtime/time.js +89 -4
  66. package/dist/modules/runtime/visits.js +6 -4
  67. package/dist/modules/theme/index.d.ts +5 -2
  68. package/dist/modules/theme/index.js +8 -4
  69. package/dist/modules/viewer/index.d.ts +28 -7
  70. package/dist/modules/viewer/index.js +223 -58
  71. package/dist/modules/viewer/runtime-content.js +26 -20
  72. package/dist/modules/viewer/runtime-trace.js +43 -25
  73. package/dist/modules/viewer/timeline.js +103 -36
  74. package/dist/shell.js +258 -75
  75. package/dist/sidebars.js +3 -1
  76. package/dist/styles.css +2371 -2
  77. package/llms-full.txt +586 -47
  78. package/llms.txt +6 -5
  79. package/package.json +7 -3
package/dist/shell.js CHANGED
@@ -3,6 +3,7 @@ import { createDefaultPaletteRegistry, PalettePanel } from './modules/palette/in
3
3
  import { createDefaultPropertiesRegistry, PropertiesPanel } from './modules/properties/index.js';
4
4
  import { BpmnViewer } from './modules/viewer/index.js';
5
5
  import { ThemeController } from './modules/theme/index.js';
6
+ import { createI18n, resolveI18n } from './modules/i18n/index.js';
6
7
  import { openSvgExportPreview } from './modules/export-svg/index.js';
7
8
  import { BpmnCanvas } from './canvas.js';
8
9
  import { StudioSidebars } from './sidebars.js';
@@ -54,9 +55,9 @@ function sameConfigValue(left, right) {
54
55
 
55
56
  const STUDIO_MODES = ['design', 'viewer', 'instance'];
56
57
  const STUDIO_MODE_OPTIONS = Object.freeze([
57
- Object.freeze({ value: 'design', label: '流程设计', iconId: 'ui.design' }),
58
- Object.freeze({ value: 'viewer', label: '流程展示', iconId: 'ui.preview' }),
59
- Object.freeze({ value: 'instance', label: '审批轨迹', iconId: 'ui.trace' }),
58
+ Object.freeze({ value: 'design', labelKey: 'shell.modes.design', iconId: 'ui.design' }),
59
+ Object.freeze({ value: 'viewer', labelKey: 'shell.modes.viewer', iconId: 'ui.preview' }),
60
+ Object.freeze({ value: 'instance', labelKey: 'shell.modes.instance', iconId: 'ui.trace' }),
60
61
  ]);
61
62
  const STUDIO_SHELL_REGIONS = ['header', 'left', 'right', 'footer'];
62
63
 
@@ -96,10 +97,15 @@ export class BpmnStudioShell {
96
97
  timeline,
97
98
  runtimeDetails,
98
99
  runtimeTraceOptions,
100
+ formatRuntimeTime,
101
+ runtimeTimeFormat,
99
102
  theme = null,
100
103
  runtimeAppearance = null,
101
104
  svgExport = null,
102
105
  onThemeChange = null,
106
+ i18n = null,
107
+ locale,
108
+ messages,
103
109
  } = options;
104
110
  if (!container || !studio) throw new Error('BpmnStudioShell requires container and studio.');
105
111
  const configuredRegions = regions !== null && regions !== undefined
@@ -107,16 +113,36 @@ export class BpmnStudioShell {
107
113
  if (typeof layout === 'function' && configuredRegions) {
108
114
  throw new Error('BpmnStudioShell options "layout" and "regions" cannot be used together.');
109
115
  }
116
+ const hasExplicitLocale = locale !== undefined || messages !== undefined;
117
+ if (i18n) {
118
+ this._ownsI18n = false;
119
+ this._sharesStudioI18n = Boolean(studio?.i18n && i18n === studio.i18n);
120
+ this.i18n = resolveI18n(i18n);
121
+ } else if (studio?.i18n) {
122
+ this._ownsI18n = false;
123
+ this._sharesStudioI18n = true;
124
+ this.i18n = resolveI18n(studio.i18n);
125
+ if (hasExplicitLocale) {
126
+ if (typeof studio.setLocale === 'function') studio.setLocale(locale, messages);
127
+ else this.i18n.setLocale(locale, messages);
128
+ }
129
+ } else {
130
+ this._ownsI18n = true;
131
+ this._sharesStudioI18n = false;
132
+ this.i18n = createI18n({ locale, messages });
133
+ }
110
134
  const fallbackConfig = {
111
135
  viewer: {
112
136
  timeline: rendererOptions.timeline,
113
137
  runtimeDetails: rendererOptions.runtimeDetails,
114
138
  runtimeTraceOptions: rendererOptions.runtimeTraceOptions,
139
+ formatRuntimeTime: rendererOptions.formatRuntimeTime,
140
+ runtimeTimeFormat: rendererOptions.runtimeTimeFormat,
115
141
  },
116
142
  export: rendererOptions.svgExport,
117
143
  };
118
144
  const legacyConfig = {};
119
- for (const name of ['regions', 'leftWidth', 'rightWidth', 'responsive', 'projectionOptions', 'timeline', 'runtimeDetails', 'runtimeTraceOptions', 'svgExport']) {
145
+ for (const name of ['regions', 'leftWidth', 'rightWidth', 'responsive', 'projectionOptions', 'timeline', 'runtimeDetails', 'runtimeTraceOptions', 'formatRuntimeTime', 'runtimeTimeFormat', 'svgExport']) {
120
146
  if (Object.prototype.hasOwnProperty.call(options, name)) legacyConfig[name] = options[name];
121
147
  }
122
148
  const normalizedConfig = normalizeStudioConfig(config, { fallback: fallbackConfig, legacy: legacyConfig });
@@ -139,6 +165,8 @@ export class BpmnStudioShell {
139
165
  timeline: resolvedViewer.timeline,
140
166
  runtimeDetails: resolvedViewer.runtimeDetails,
141
167
  runtimeTraceOptions: resolvedViewer.runtimeTraceOptions,
168
+ formatRuntimeTime: resolvedViewer.formatRuntimeTime,
169
+ runtimeTimeFormat: resolvedViewer.runtimeTimeFormat,
142
170
  },
143
171
  slots,
144
172
  runtime,
@@ -159,7 +187,7 @@ export class BpmnStudioShell {
159
187
  _controlMetrics: resolveStudioControlMetrics(resolvedUi.controlSize),
160
188
  });
161
189
  this.ui = createStudioUiContext(() => this._controlMetrics);
162
- this.propertiesRegistry = propertiesRegistry || createDefaultPropertiesRegistry({ studio });
190
+ this.propertiesRegistry = propertiesRegistry || createDefaultPropertiesRegistry({ studio, i18n: this.i18n });
163
191
  this.interactions = createInteractionController({ studio, templates: templateRegistry });
164
192
  this._cleanups = [];
165
193
  this._instances = [];
@@ -196,6 +224,9 @@ export class BpmnStudioShell {
196
224
  const context = {
197
225
  studio,
198
226
  shell: this,
227
+ i18n: this.i18n,
228
+ getLocale: () => this.getLocale(),
229
+ setLocale: (nextLocale, nextMessages) => this.setLocale(nextLocale, nextMessages),
199
230
  actions: this.actions,
200
231
  ui: this.ui,
201
232
  getState: () => this.studio.getState(),
@@ -230,7 +261,25 @@ export class BpmnStudioShell {
230
261
  this._recordCleanup(this.studio.subscribe((event) => {
231
262
  if (['selectionChanged', 'modelChanged', 'scopeChanged'].includes(event.type)) this._updatePanelSelection();
232
263
  }));
264
+ this._recordCleanup(this.i18n.subscribe(() => this._syncLocaleChrome()));
265
+ }
266
+ }
267
+
268
+ _t(key, params) {
269
+ return this.i18n.t(key, params);
270
+ }
271
+
272
+ setLocale(locale, messages) {
273
+ if (this._sharesStudioI18n && typeof this.studio?.setLocale === 'function') {
274
+ this.studio.setLocale(locale, messages);
275
+ } else {
276
+ this.i18n.setLocale(locale, messages);
233
277
  }
278
+ return this.getLocale();
279
+ }
280
+
281
+ getLocale() {
282
+ return this.i18n.getState();
234
283
  }
235
284
 
236
285
  _buildDefault(context, mount) {
@@ -242,10 +291,10 @@ export class BpmnStudioShell {
242
291
  brandCopy.append(node('strong', '', 'BPMN Nova'), node('span', '', this.studio.model.name));
243
292
  brand.append(brandMark, brandCopy);
244
293
  const modeSwitch = node('nav', 'nova-studio-mode-switch');
245
- modeSwitch.setAttribute('aria-label', 'Studio 模式');
294
+ modeSwitch.setAttribute('aria-label', this._t('shell.modeAria'));
246
295
  const modeButtons = new Map();
247
296
  const projectionSwitch = node('nav', 'nova-studio-projection-switch is-hidden');
248
- projectionSwitch.setAttribute('aria-label', '审批轨迹视图');
297
+ projectionSwitch.setAttribute('aria-label', this._t('shell.projectionAria'));
249
298
  const projectionButtons = new Map();
250
299
  const centerControls = node('div', 'nova-studio-center-controls');
251
300
  centerControls.append(modeSwitch, projectionSwitch);
@@ -258,52 +307,60 @@ export class BpmnStudioShell {
258
307
  };
259
308
 
260
309
  const divider = () => tools.appendChild(node('span', 'nova-studio-tool-divider'));
261
- const undo = tool('', '撤销 Ctrl/⌘+Z', () => this.actions.undo(), 'is-icon', 'ui.undo');
262
- const redo = tool('', '重做 Ctrl/⌘+Y', () => this.actions.redo(), 'is-icon', 'ui.redo');
310
+ const undo = tool('', this._t('shell.tools.undo'), () => this.actions.undo(), 'is-icon', 'ui.undo');
311
+ const redo = tool('', this._t('shell.tools.redo'), () => this.actions.redo(), 'is-icon', 'ui.redo');
263
312
  divider();
264
313
  const beautifySplit = node('div', 'nova-studio-beautify-split');
265
314
  const beautifyButton = node('button', 'nova-studio-tool nova-studio-beautify is-magic');
266
315
  beautifyButton.type = 'button';
267
- beautifyButton.title = '按当前设置整理节点与连线';
268
- beautifyButton.append(iconNode('ui.magic'), node('span', '', '一键美化'));
316
+ beautifyButton.title = this._t('shell.tools.beautifyTitle');
317
+ const beautifyButtonLabel = node('span', '', this._t('shell.tools.beautify'));
318
+ beautifyButton.append(iconNode('ui.magic'), beautifyButtonLabel);
269
319
  beautifyButton.addEventListener('click', () => this._runBeautify());
270
320
  const beautifyCaret = node('button', 'nova-studio-tool nova-studio-beautify-caret is-magic');
271
321
  beautifyCaret.type = 'button';
272
- beautifyCaret.title = '选择布局策略';
322
+ beautifyCaret.title = this._t('shell.tools.beautifyStrategyTitle');
273
323
  beautifyCaret.appendChild(iconNode('ui.chevron', 'nova-icon nova-icon-xs'));
274
324
  const beautifyMenu = node('div', 'nova-studio-beautify-menu is-hidden');
275
- beautifyMenu.append(node('div', 'nova-studio-beautify-title', '布局策略'));
325
+ const beautifyMenuTitle = node('div', 'nova-studio-beautify-title', this._t('shell.tools.beautifyMenuTitle'));
326
+ beautifyMenu.append(beautifyMenuTitle);
276
327
  const density = node('div', 'nova-studio-density');
328
+ const densityButtons = new Map();
277
329
  for (const item of [
278
- { value: 'compact', label: '紧凑' },
279
- { value: 'balanced', label: '标准' },
280
- { value: 'spacious', label: '舒展' },
330
+ { value: 'compact', labelKey: 'shell.density.compact' },
331
+ { value: 'balanced', labelKey: 'shell.density.balanced' },
332
+ { value: 'spacious', labelKey: 'shell.density.spacious' },
281
333
  ]) {
282
- const button = node('button', '', item.label);
334
+ const button = node('button', '', this._t(item.labelKey));
283
335
  button.type = 'button';
284
336
  button.setAttribute('data-density', item.value);
285
337
  button.addEventListener('click', () => {
286
338
  this.studio.commands.updateProcess({ settings: { layoutDensity: item.value } });
287
339
  this._syncDensityButtons();
288
340
  });
341
+ densityButtons.set(item.value, { button, labelKey: item.labelKey });
289
342
  density.appendChild(button);
290
343
  }
291
344
  beautifyMenu.appendChild(density);
292
345
  const actionList = node('div', 'nova-studio-beautify-actions');
346
+ const beautifyActionRefs = [];
293
347
  for (const item of [
294
- { value: 'horizontal', iconId: 'ui.layoutHorizontal', label: '横向智能布局', hint: '按审批流方向重新排版' },
295
- { value: 'vertical', iconId: 'ui.layoutVertical', label: '纵向智能布局', hint: '按审批层级纵向排版' },
296
- { value: 'routing', iconId: 'ui.routeRounded', label: '重算圆角连线', hint: '保留节点位置,仅重算线路' },
297
- { value: 'smooth', iconId: 'ui.routeSmooth', label: '柔和曲线连线', hint: '保留节点位置,增强连线弧度' },
348
+ { value: 'horizontal', iconId: 'ui.layoutHorizontal', labelKey: 'shell.beautifyActions.horizontal', hintKey: 'shell.beautifyActions.horizontalHint' },
349
+ { value: 'vertical', iconId: 'ui.layoutVertical', labelKey: 'shell.beautifyActions.vertical', hintKey: 'shell.beautifyActions.verticalHint' },
350
+ { value: 'routing', iconId: 'ui.routeRounded', labelKey: 'shell.beautifyActions.routing', hintKey: 'shell.beautifyActions.routingHint' },
351
+ { value: 'smooth', iconId: 'ui.routeSmooth', labelKey: 'shell.beautifyActions.smooth', hintKey: 'shell.beautifyActions.smoothHint' },
298
352
  ]) {
299
353
  const button = node('button', 'nova-studio-beautify-action');
300
354
  button.type = 'button';
301
355
  button.setAttribute('data-beautify', item.value);
302
- button.append(iconNode(item.iconId, 'nova-icon nova-studio-beautify-action-icon'), node('strong', '', item.label), node('small', '', item.hint));
356
+ const strong = node('strong', '', this._t(item.labelKey));
357
+ const small = node('small', '', this._t(item.hintKey));
358
+ button.append(iconNode(item.iconId, 'nova-icon nova-studio-beautify-action-icon'), strong, small);
303
359
  button.addEventListener('click', () => {
304
360
  this._runBeautify(item.value);
305
361
  beautifyMenu.classList.add('is-hidden');
306
362
  });
363
+ beautifyActionRefs.push({ strong, small, labelKey: item.labelKey, hintKey: item.hintKey });
307
364
  actionList.appendChild(button);
308
365
  }
309
366
  beautifyMenu.appendChild(actionList);
@@ -318,24 +375,33 @@ export class BpmnStudioShell {
318
375
  let validateButton = null;
319
376
  let importButton = null;
320
377
  let exportMenu = null;
378
+ let exportButton = null;
379
+ let exportButtonLabel = null;
321
380
  let exportPopover = null;
381
+ let exportSvgStrong = null;
382
+ let exportSvgSmall = null;
322
383
  let exportBpmnButton = null;
384
+ let exportBpmnStrong = null;
385
+ let exportBpmnSmall = null;
323
386
  if (!this.slots.headerActions) {
324
387
  const importInput = node('input', 'nova-studio-import-input');
325
388
  importInput.type = 'file';
326
389
  importInput.accept = '.bpmn,.xml,.bpmn20.xml,text/xml,application/xml';
327
390
  importInput.hidden = true;
328
- validateButton = tool('校验', '校验流程结构', () => this.actions.validate(), 'nova-studio-validate', null, headerActions);
329
- importButton = tool('导入', '导入 BPMN XML', () => importInput.click(), 'nova-studio-import', null, headerActions);
391
+ validateButton = tool(this._t('shell.tools.validate'), this._t('shell.tools.validateTitle'), () => this.actions.validate(), 'nova-studio-validate', null, headerActions);
392
+ importButton = tool(this._t('shell.tools.import'), this._t('shell.tools.importTitle'), () => importInput.click(), 'nova-studio-import', null, headerActions);
330
393
  exportMenu = node('div', 'nova-studio-export-menu');
331
- const exportButton = node('button', 'nova-studio-tool nova-studio-export is-primary');
394
+ exportButton = node('button', 'nova-studio-tool nova-studio-export is-primary');
332
395
  exportButton.type = 'button';
333
- exportButton.title = '导出当前内容';
334
- exportButton.append(node('span', '', '导出'), iconNode('ui.chevron', 'nova-icon nova-icon-xs'));
396
+ exportButton.title = this._t('shell.tools.exportTitle');
397
+ exportButtonLabel = node('span', '', this._t('shell.tools.export'));
398
+ exportButton.append(exportButtonLabel, iconNode('ui.chevron', 'nova-icon nova-icon-xs'));
335
399
  exportPopover = node('div', 'nova-studio-export-popover is-hidden');
336
400
  const exportSvgButton = node('button', 'nova-studio-export-option');
337
401
  exportSvgButton.type = 'button';
338
- exportSvgButton.append(iconNode('ui.preview'), node('strong', '', '导出 SVG'), node('small', '', '预览确认后下载'));
402
+ exportSvgStrong = node('strong', '', this._t('shell.tools.exportSvg'));
403
+ exportSvgSmall = node('small', '', this._t('shell.tools.exportSvgHint'));
404
+ exportSvgButton.append(iconNode('ui.preview'), exportSvgStrong, exportSvgSmall);
339
405
  exportSvgButton.addEventListener('click', () => {
340
406
  exportPopover.classList.add('is-hidden');
341
407
  exportButton.focus({ preventScroll: true });
@@ -343,7 +409,9 @@ export class BpmnStudioShell {
343
409
  });
344
410
  exportBpmnButton = node('button', 'nova-studio-export-option');
345
411
  exportBpmnButton.type = 'button';
346
- exportBpmnButton.append(iconNode('ui.design'), node('strong', '', '导出 BPMN'), node('small', '', '下载流程 XML'));
412
+ exportBpmnStrong = node('strong', '', this._t('shell.tools.exportBpmn'));
413
+ exportBpmnSmall = node('small', '', this._t('shell.tools.exportBpmnHint'));
414
+ exportBpmnButton.append(iconNode('ui.design'), exportBpmnStrong, exportBpmnSmall);
347
415
  exportBpmnButton.addEventListener('click', () => {
348
416
  exportPopover.classList.add('is-hidden');
349
417
  this._exportBpmn();
@@ -360,10 +428,10 @@ export class BpmnStudioShell {
360
428
  if (!file) return;
361
429
  try {
362
430
  this.actions.importXml(await file.text(), this.studio.model.engine);
363
- this._setStatus('已导入 BPMN 文件', 'ok');
431
+ this._setStatus(this._t('shell.status.importedBpmn'), 'ok');
364
432
  requestAnimationFrame(() => this._fitActive());
365
433
  } catch (error) {
366
- this._setStatus(`导入失败:${error.message}`, 'error');
434
+ this._setStatus(this._t('shell.status.importFailed', { message: error.message }), 'error');
367
435
  } finally {
368
436
  importInput.value = '';
369
437
  }
@@ -379,20 +447,22 @@ export class BpmnStudioShell {
379
447
  const canvasHost = node('main', 'nova-studio-canvas');
380
448
  const floatingHead = node('div', 'nova-studio-canvas-floating-head');
381
449
  const editingMode = node('strong', 'nova-studio-editing-mode');
382
- editingMode.append(iconNode('ui.design', 'nova-icon nova-icon-xs'), node('span', 'nova-studio-editing-mode-label', '编辑模式'));
450
+ const editingModeLabel = node('span', 'nova-studio-editing-mode-label', this._t('shell.canvasHead.editingMode'));
451
+ editingMode.append(iconNode('ui.design', 'nova-icon nova-icon-xs'), editingModeLabel);
383
452
  const scopeBack = node('button', 'nova-studio-scope-back');
384
453
  scopeBack.type = 'button';
385
454
  scopeBack.hidden = true;
386
- scopeBack.append(iconNode('ui.leaveScope', 'nova-icon nova-icon-sm'), node('span', '', '返回上一级'));
455
+ const scopeBackLabel = node('span', '', this._t('shell.canvasHead.back'));
456
+ scopeBack.append(iconNode('ui.leaveScope', 'nova-icon nova-icon-sm'), scopeBackLabel);
387
457
  scopeBack.addEventListener('click', () => this.studio.leaveScope());
388
458
  const scopeNav = node('nav', 'nova-studio-scope-nav');
389
- scopeNav.setAttribute('aria-label', '流程层级');
459
+ scopeNav.setAttribute('aria-label', this._t('shell.canvasHead.scopeNavAria'));
390
460
  floatingHead.append(editingMode, scopeBack, scopeNav);
391
461
  canvasStage.append(canvasHost, floatingHead);
392
462
  const statusbar = node('footer', 'nova-studio-statusbar');
393
463
  const statusLeft = node('div', 'nova-studio-status-left');
394
464
  this._statusDot = node('i', 'is-ok');
395
- this._statusText = node('span', '', '就绪');
465
+ this._statusText = node('span', '', this._t('shell.status.ready'));
396
466
  statusLeft.append(this._statusDot, this._statusText);
397
467
  const viewportTools = node('div', 'nova-studio-viewport-tools');
398
468
  const viewportTool = (label, title, action, className = '', iconId = null) => {
@@ -401,13 +471,13 @@ export class BpmnStudioShell {
401
471
  if (label) button.appendChild(node('span', '', label));
402
472
  button.addEventListener('click', action); viewportTools.appendChild(button); return button;
403
473
  };
404
- viewportTool('', '缩小', () => this._zoomActive(0.9), '', 'ui.zoomOut');
474
+ const zoomOutBtn = viewportTool('', this._t('shell.viewport.zoomOut'), () => this._zoomActive(0.9), '', 'ui.zoomOut');
405
475
  this._zoomText = node('span', 'nova-studio-zoom-text', '100%');
406
476
  viewportTools.appendChild(this._zoomText);
407
- viewportTool('', '放大', () => this._zoomActive(1.1), '', 'ui.zoomIn');
477
+ const zoomInBtn = viewportTool('', this._t('shell.viewport.zoomIn'), () => this._zoomActive(1.1), '', 'ui.zoomIn');
408
478
  viewportTools.appendChild(node('span', 'nova-studio-status-divider'));
409
- viewportTool('1:1', '100% 实际大小', () => this._actualSize(), 'is-text');
410
- viewportTool('', '最佳视图', () => this._fitActive(), 'is-fit', 'ui.fitView');
479
+ const actualSizeBtn = viewportTool('1:1', this._t('shell.viewport.actualSize'), () => this._actualSize(), 'is-text');
480
+ const fitViewBtn = viewportTool('', this._t('shell.viewport.fitView'), () => this._fitActive(), 'is-fit', 'ui.fitView');
411
481
  statusbar.append(statusLeft, viewportTools);
412
482
  canvasColumn.append(canvasStage, statusbar);
413
483
  const right = node('aside', 'nova-studio-right');
@@ -418,6 +488,30 @@ export class BpmnStudioShell {
418
488
  body.append(left, canvasColumn, right);
419
489
  this.container.append(header, body);
420
490
  hydrateIcons(this.container, this.iconRegistry);
491
+ this._localeRefs = {
492
+ undo,
493
+ redo,
494
+ beautifyButton,
495
+ beautifyButtonLabel,
496
+ beautifyCaret,
497
+ beautifyMenuTitle,
498
+ densityButtons,
499
+ beautifyActionRefs,
500
+ validateButton,
501
+ importButton,
502
+ exportButton,
503
+ exportButtonLabel,
504
+ exportSvgStrong,
505
+ exportSvgSmall,
506
+ exportBpmnStrong,
507
+ exportBpmnSmall,
508
+ editingModeLabel,
509
+ scopeBackLabel,
510
+ zoomOutBtn,
511
+ zoomInBtn,
512
+ actualSizeBtn,
513
+ fitViewBtn,
514
+ };
421
515
  Object.assign(this, {
422
516
  _header: header,
423
517
  _headerStart: brand,
@@ -486,19 +580,19 @@ export class BpmnStudioShell {
486
580
  if (this.viewer) this.viewer.setModel(this.studio.model);
487
581
  this._syncDensityButtons();
488
582
  const graph = this.studio.getActiveGraph();
489
- this._setStatus(`${graph.nodes.length} 节点 · ${graph.edges.length} 连线`, 'ok');
583
+ this._setStatus(this._t('shell.status.graphSummary', { nodes: graph.nodes.length, edges: graph.edges.length }), 'ok');
490
584
  }
491
585
  if (event.type === 'scopeChanged' || event.type === 'modelChanged') this._renderScopePath();
492
586
  if (event.type === 'scopeChanged') {
493
587
  const graph = this.studio.getActiveGraph();
494
- this._setStatus(`${graph.nodes.length} 节点 · ${graph.edges.length} 连线`, 'ok');
588
+ this._setStatus(this._t('shell.status.graphSummary', { nodes: graph.nodes.length, edges: graph.edges.length }), 'ok');
495
589
  }
496
590
  });
497
591
  this._cleanups.push(this._offState);
498
592
  undo.disabled = !this.studio.history.canUndo;
499
593
  redo.disabled = !this.studio.history.canRedo;
500
594
  const initialGraph = this.studio.getActiveGraph();
501
- this._setStatus(`${initialGraph.nodes.length} 节点 · ${initialGraph.edges.length} 连线`, 'ok');
595
+ this._setStatus(this._t('shell.status.graphSummary', { nodes: initialGraph.nodes.length, edges: initialGraph.edges.length }), 'ok');
502
596
  const closeBeautify = (event) => {
503
597
  if (!beautifySplit.contains(event.target)) beautifyMenu.classList.add('is-hidden');
504
598
  if (exportMenu && !exportMenu.contains(event.target)) exportPopover.classList.add('is-hidden');
@@ -509,6 +603,55 @@ export class BpmnStudioShell {
509
603
  this._setMode(this.mode, { force: true, emit: false });
510
604
  }
511
605
 
606
+ _syncLocaleChrome() {
607
+ if (this._destroyed) return;
608
+ const refs = this._localeRefs;
609
+ if (this._modeSwitch) this._modeSwitch.setAttribute('aria-label', this._t('shell.modeAria'));
610
+ if (this._projectionSwitch) this._projectionSwitch.setAttribute('aria-label', this._t('shell.projectionAria'));
611
+ if (refs) {
612
+ if (refs.undo) refs.undo.title = this._t('shell.tools.undo');
613
+ if (refs.redo) refs.redo.title = this._t('shell.tools.redo');
614
+ if (refs.beautifyButton) refs.beautifyButton.title = this._t('shell.tools.beautifyTitle');
615
+ if (refs.beautifyButtonLabel) refs.beautifyButtonLabel.textContent = this._t('shell.tools.beautify');
616
+ if (refs.beautifyCaret) refs.beautifyCaret.title = this._t('shell.tools.beautifyStrategyTitle');
617
+ if (refs.beautifyMenuTitle) refs.beautifyMenuTitle.textContent = this._t('shell.tools.beautifyMenuTitle');
618
+ refs.densityButtons?.forEach(({ button, labelKey }) => { button.textContent = this._t(labelKey); });
619
+ refs.beautifyActionRefs?.forEach(({ strong, small, labelKey, hintKey }) => {
620
+ strong.textContent = this._t(labelKey);
621
+ small.textContent = this._t(hintKey);
622
+ });
623
+ if (refs.validateButton) {
624
+ refs.validateButton.title = this._t('shell.tools.validateTitle');
625
+ const span = refs.validateButton.querySelector('span');
626
+ if (span) span.textContent = this._t('shell.tools.validate');
627
+ }
628
+ if (refs.importButton) {
629
+ refs.importButton.title = this._t('shell.tools.importTitle');
630
+ const span = refs.importButton.querySelector('span');
631
+ if (span) span.textContent = this._t('shell.tools.import');
632
+ }
633
+ if (refs.exportButton) refs.exportButton.title = this._t('shell.tools.exportTitle');
634
+ if (refs.exportButtonLabel) refs.exportButtonLabel.textContent = this._t('shell.tools.export');
635
+ if (refs.exportSvgStrong) refs.exportSvgStrong.textContent = this._t('shell.tools.exportSvg');
636
+ if (refs.exportSvgSmall) refs.exportSvgSmall.textContent = this._t('shell.tools.exportSvgHint');
637
+ if (refs.exportBpmnStrong) refs.exportBpmnStrong.textContent = this._t('shell.tools.exportBpmn');
638
+ if (refs.exportBpmnSmall) refs.exportBpmnSmall.textContent = this._t('shell.tools.exportBpmnHint');
639
+ if (refs.editingModeLabel) refs.editingModeLabel.textContent = this._t('shell.canvasHead.editingMode');
640
+ if (refs.scopeBackLabel) refs.scopeBackLabel.textContent = this._t('shell.canvasHead.back');
641
+ if (refs.zoomOutBtn) refs.zoomOutBtn.title = this._t('shell.viewport.zoomOut');
642
+ if (refs.zoomInBtn) refs.zoomInBtn.title = this._t('shell.viewport.zoomIn');
643
+ if (refs.actualSizeBtn) refs.actualSizeBtn.title = this._t('shell.viewport.actualSize');
644
+ if (refs.fitViewBtn) refs.fitViewBtn.title = this._t('shell.viewport.fitView');
645
+ }
646
+ if (this._scopeNav) this._scopeNav.setAttribute('aria-label', this._t('shell.canvasHead.scopeNavAria'));
647
+ this._rebuildModeButtons();
648
+ this._rebuildProjectionButtons();
649
+ this._renderScopePath();
650
+ this._syncProjectionChrome();
651
+ this._sidebars?.apply({ animate: false });
652
+ if (this.mode !== 'design') this._renderReadonlyDetails(this._readonlyPanelDetails());
653
+ }
654
+
512
655
  _syncCanvasHead() {
513
656
  if (!this._floatingHead) return;
514
657
  const { editingMode, scopePath } = this._config.ui.canvasHead;
@@ -529,8 +672,10 @@ export class BpmnStudioShell {
529
672
  this._syncCanvasHead();
530
673
  this._scopeBack.hidden = !parent;
531
674
  if (parent) {
532
- this._scopeBack.title = `返回上一级:${parent.name}`;
533
- this._scopeBack.setAttribute('aria-label', `返回上一级:${parent.name}`);
675
+ const backLabel = this._t('shell.canvasHead.backToParent', { name: parent.name });
676
+ this._scopeBack.title = backLabel;
677
+ if (backLabel === `返回上一级:${parent.name}`) this._scopeBack.setAttribute('aria-label', `返回上一级:${parent.name}`);
678
+ else this._scopeBack.setAttribute('aria-label', backLabel);
534
679
  } else {
535
680
  this._scopeBack.removeAttribute('title');
536
681
  this._scopeBack.removeAttribute('aria-label');
@@ -550,7 +695,7 @@ export class BpmnStudioShell {
550
695
  }
551
696
  const button = node('button', `nova-studio-scope-ancestor${index === 0 ? ' is-root' : ''}`, item.name);
552
697
  button.type = 'button';
553
- button.title = `返回 ${item.name}`;
698
+ button.title = this._t('shell.canvasHead.backToScope', { name: item.name });
554
699
  button.addEventListener('click', () => this.studio.navigateToScope(item.id));
555
700
  this._scopeNav.appendChild(button);
556
701
  });
@@ -583,14 +728,15 @@ export class BpmnStudioShell {
583
728
  this._modeSwitch.classList.toggle('is-hidden', single);
584
729
  if (single) return;
585
730
  for (const item of STUDIO_MODE_OPTIONS.filter(({ value }) => this.allowedModes.includes(value))) {
731
+ const label = this._t(item.labelKey);
586
732
  const button = node('button');
587
733
  const active = item.value === this.mode;
588
734
  button.type = 'button';
589
735
  button.setAttribute('data-mode', item.value);
590
- button.setAttribute('aria-label', `切换到${item.label}`);
736
+ button.setAttribute('aria-label', this._t('shell.modeSwitchTo', { label }));
591
737
  button.setAttribute('aria-pressed', String(active));
592
738
  button.classList.toggle('is-active', active);
593
- button.append(iconNode(item.iconId, 'nova-icon nova-icon-xs'), node('span', '', item.label));
739
+ button.append(iconNode(item.iconId, 'nova-icon nova-icon-xs'), node('span', '', label));
594
740
  button.addEventListener('click', () => this.setMode(item.value, 'toolbar'));
595
741
  this._modeButtons.set(item.value, button);
596
742
  this._modeSwitch.appendChild(button);
@@ -602,9 +748,10 @@ export class BpmnStudioShell {
602
748
  if (!this._projectionSwitch) return;
603
749
  this._projectionSwitch.replaceChildren();
604
750
  this._projectionButtons = new Map();
751
+ // Default zh-CN projection labels: 实际路径 / 完整 BPMN
605
752
  const options = this.projectionOptions || [
606
- { value: this.responsive ? 'auto' : 'approval', label: '实际路径' },
607
- { value: 'standard', label: '完整 BPMN' },
753
+ { value: this.responsive ? 'auto' : 'approval', label: this._t('shell.projections.approval') },
754
+ { value: 'standard', label: this._t('shell.projections.standard') },
608
755
  ];
609
756
  for (const item of options) {
610
757
  const button = node('button', '', item.label);
@@ -642,11 +789,15 @@ export class BpmnStudioShell {
642
789
  this._viewportTools?.classList.toggle('is-hidden', timeline);
643
790
  if (this.mode === 'design') {
644
791
  const graph = this.studio.getActiveGraph();
645
- this._setStatus(`${graph.nodes.length} 节点 · ${graph.edges.length} 连线`, 'ok');
646
- } else if (this.mode === 'viewer') this._setStatus('流程展示 · 只读预览', 'ok');
792
+ this._setStatus(this._t('shell.status.graphSummary', { nodes: graph.nodes.length, edges: graph.edges.length }), 'ok');
793
+ } else if (this.mode === 'viewer') this._setStatus(this._t('shell.status.viewerReadonly'), 'ok');
647
794
  else {
648
795
  const active = this.viewer?.activeProjection || this.projection;
649
- const status = active === 'compact' ? '审批轨迹 · 移动时间线' : active === 'standard' ? '审批轨迹 · 完整 BPMN' : '审批轨迹 · 实际路径';
796
+ const status = active === 'compact'
797
+ ? this._t('shell.status.traceTimeline')
798
+ : active === 'standard'
799
+ ? this._t('shell.status.traceStandard')
800
+ : this._t('shell.status.traceApproval');
650
801
  this._setStatus(status, 'ok');
651
802
  }
652
803
  }
@@ -676,6 +827,7 @@ export class BpmnStudioShell {
676
827
  viewer = new BpmnViewer({
677
828
  container,
678
829
  themeController: this.themeController,
830
+ i18n: this.i18n,
679
831
  runtimeAppearance: this.runtimeAppearance,
680
832
  model: this.studio.model,
681
833
  mode,
@@ -689,6 +841,8 @@ export class BpmnStudioShell {
689
841
  runtimeTraceOptions: this.rendererOptions.runtimeTraceOptions,
690
842
  timeline: this.rendererOptions.timeline,
691
843
  runtimeDetails: this.rendererOptions.runtimeDetails,
844
+ formatRuntimeTime: this.rendererOptions.formatRuntimeTime,
845
+ runtimeTimeFormat: this.rendererOptions.runtimeTimeFormat,
692
846
  runtimePresenter: this.rendererOptions.runtimePresenter,
693
847
  runtimeTraceProjector: this.rendererOptions.runtimeTraceProjector,
694
848
  runtimeAssetResolver: this.rendererOptions.runtimeAssetResolver,
@@ -879,23 +1033,39 @@ export class BpmnStudioShell {
879
1033
  this._rightContent.innerHTML = '';
880
1034
  const panel = node('div', 'nova-studio-readonly-panel');
881
1035
  const header = node('header', 'nova-studio-readonly-header');
882
- header.append(node('strong', '', element?.name || (selection?.kind === 'edge' ? '流程连线' : model.name)), node('span', '', element?.id || model.id));
883
- const badge = node('em', '', this.mode === 'instance' ? '运行轨迹' : '只读');
1036
+ header.append(node('strong', '', element?.name || (selection?.kind === 'edge' ? this._t('shell.readonlyDetails.edgeFallbackTitle') : model.name)), node('span', '', element?.id || model.id));
1037
+ const badge = node('em', '', this.mode === 'instance' ? this._t('shell.readonlyDetails.traceBadge') : this._t('shell.readonlyDetails.readonlyBadge'));
884
1038
  header.appendChild(badge);
885
1039
  panel.appendChild(header);
886
1040
  const runtimeRows = this.mode === 'instance' && selection?.presentation
887
1041
  ? [
888
- ['当前状态', selection.presentation.statusLabel],
889
- ['处理人员', selection.presentation.fullSummary || selection.presentation.summary || '-'],
890
- ['处理轮次', selection.presentation.round ? `第 ${selection.presentation.round} 次` : '-'],
891
- ...(selection.presentation.actionSummary ? [['最近操作', selection.presentation.actionSummary]] : []),
1042
+ [this._t('shell.readonlyDetails.currentStatus'), selection.presentation.statusLabel],
1043
+ [this._t('shell.readonlyDetails.participants'), selection.presentation.fullSummary || selection.presentation.summary || '-'],
1044
+ [this._t('shell.readonlyDetails.round'), selection.presentation.round ? this._t('shell.readonlyDetails.roundValue', { round: selection.presentation.round }) : '-'],
1045
+ ...(selection.presentation.actionSummary ? [[this._t('shell.readonlyDetails.latestAction'), selection.presentation.actionSummary]] : []),
892
1046
  ]
893
1047
  : [];
894
1048
  const rows = selection?.kind === 'node'
895
- ? [...runtimeRows, ['元素类型', element.type], ['BPMN 类型', element.bpmnType || '-'], ['名称', element.name || '-'], ['Element ID', element.id]]
1049
+ ? [
1050
+ ...runtimeRows,
1051
+ [this._t('shell.readonlyDetails.elementType'), element.type],
1052
+ [this._t('shell.readonlyDetails.bpmnType'), element.bpmnType || '-'],
1053
+ [this._t('shell.readonlyDetails.name'), element.name || '-'],
1054
+ [this._t('shell.readonlyDetails.elementId'), element.id],
1055
+ ]
896
1056
  : selection?.kind === 'edge'
897
- ? [['来源', element.source], ['目标', element.target], ['条件', element.condition || '-'], ['Element ID', element.id]]
898
- : [['流程名称', model.name], ['流程引擎', model.engine], ['节点数量', String(model.nodes.length)], ['连线数量', String(model.edges.length)]];
1057
+ ? [
1058
+ [this._t('shell.readonlyDetails.source'), element.source],
1059
+ [this._t('shell.readonlyDetails.target'), element.target],
1060
+ [this._t('shell.readonlyDetails.condition'), element.condition || '-'],
1061
+ [this._t('shell.readonlyDetails.elementId'), element.id],
1062
+ ]
1063
+ : [
1064
+ [this._t('shell.readonlyDetails.processName'), model.name],
1065
+ [this._t('shell.readonlyDetails.engine'), model.engine],
1066
+ [this._t('shell.readonlyDetails.nodeCount'), String(model.nodes.length)],
1067
+ [this._t('shell.readonlyDetails.edgeCount'), String(model.edges.length)],
1068
+ ];
899
1069
  const body = node('div', 'nova-studio-readonly-body');
900
1070
  for (const [label, value] of rows) {
901
1071
  const row = node('div', 'nova-studio-readonly-row');
@@ -950,7 +1120,7 @@ export class BpmnStudioShell {
950
1120
  const canvasHeadChanged = !sameConfigValue(previous.ui.canvasHead, next.ui.canvasHead);
951
1121
  const projectionOptionsChanged = !sameConfigValue(previous.viewer.projectionOptions, next.viewer.projectionOptions);
952
1122
  const responsiveChanged = previous.viewer.responsive !== next.viewer.responsive;
953
- const displayChanged = ['timeline', 'runtimeDetails', 'runtimeTraceOptions']
1123
+ const displayChanged = ['timeline', 'runtimeDetails', 'runtimeTraceOptions', 'formatRuntimeTime', 'runtimeTimeFormat']
954
1124
  .some((name) => !sameConfigValue(previous.viewer[name], next.viewer[name]));
955
1125
  const exportChanged = !sameConfigValue(previous.export, next.export);
956
1126
  const nextDefaultProjection = next.viewer.responsive ? 'auto' : 'approval';
@@ -972,6 +1142,8 @@ export class BpmnStudioShell {
972
1142
  this.rendererOptions.timeline = next.viewer.timeline;
973
1143
  this.rendererOptions.runtimeDetails = next.viewer.runtimeDetails;
974
1144
  this.rendererOptions.runtimeTraceOptions = next.viewer.runtimeTraceOptions;
1145
+ this.rendererOptions.formatRuntimeTime = next.viewer.formatRuntimeTime;
1146
+ this.rendererOptions.runtimeTimeFormat = next.viewer.runtimeTimeFormat;
975
1147
  this.svgExport = next.export || null;
976
1148
  this.rendererOptions.svgExport = this.svgExport;
977
1149
  if (projectionChanged) {
@@ -994,6 +1166,8 @@ export class BpmnStudioShell {
994
1166
  timeline: next.viewer.timeline,
995
1167
  runtimeDetails: next.viewer.runtimeDetails,
996
1168
  runtimeTraceOptions: next.viewer.runtimeTraceOptions,
1169
+ formatRuntimeTime: next.viewer.formatRuntimeTime,
1170
+ runtimeTimeFormat: next.viewer.runtimeTimeFormat,
997
1171
  replace: true,
998
1172
  });
999
1173
  } else if (projectionChanged && this.mode === 'instance') this.viewer.refresh();
@@ -1112,12 +1286,19 @@ export class BpmnStudioShell {
1112
1286
  }
1113
1287
  fitView() { this._fitActive(); }
1114
1288
  zoomBy(factor) { this._zoomActive(factor); }
1289
+ _exportViewLabel() {
1290
+ if (this.mode === 'design') return this._t('exportSvg.defaultLabels.design');
1291
+ if (this.mode === 'viewer') return this._t('exportSvg.defaultLabels.viewer');
1292
+ if (this.viewer?.activeProjection === 'compact') return this._t('exportSvg.defaultLabels.timeline');
1293
+ if (this.viewer?.activeProjection === 'approval') return this._t('exportSvg.defaultLabels.approval');
1294
+ return this._t('exportSvg.defaultLabels.standard');
1295
+ }
1115
1296
  exportSvg(options) {
1116
1297
  const active = this.canvas || this.viewer;
1117
- if (!active?.exportSvg) return Promise.reject(new Error('当前视图不支持 SVG 导出。'));
1118
- const label = this.mode === 'design' ? '流程设计' : this.mode === 'viewer' ? '流程展示' : this.viewer?.activeProjection === 'compact' ? '移动时间线' : this.viewer?.activeProjection === 'approval' ? '实际路径' : '完整 BPMN';
1298
+ if (!active?.exportSvg) return Promise.reject(new Error(this._t('shell.errors.svgExportUnsupported')));
1299
+ const label = this._exportViewLabel();
1119
1300
  const filename = options?.filename || this.svgExport?.filename || `${this.studio.model.name || this.studio.model.id}-${label}`;
1120
- return active.exportSvg({ label, ...(options || {}), filename });
1301
+ return active.exportSvg({ label, i18n: this.i18n, ...(options || {}), filename });
1121
1302
  }
1122
1303
  openSvgExportPreview(options = {}) {
1123
1304
  if (this._svgExportPreview && !this._svgExportPreview.closed) {
@@ -1126,16 +1307,17 @@ export class BpmnStudioShell {
1126
1307
  }
1127
1308
  const active = this.canvas || this.viewer;
1128
1309
  if (!active?.exportSvg) return null;
1129
- const label = this.mode === 'design' ? '流程设计' : this.mode === 'viewer' ? '流程展示' : this.viewer?.activeProjection === 'compact' ? '移动时间线' : this.viewer?.activeProjection === 'approval' ? '实际路径' : '完整 BPMN';
1310
+ const label = this._exportViewLabel();
1130
1311
  const filename = options.filename || this.svgExport?.filename || `${this.studio.model.name || this.studio.model.id}-${label}`;
1131
1312
  this._svgExportPreview = openSvgExportPreview({
1132
1313
  container: this.container,
1133
- title: options.previewTitle || `导出 ${label} SVG`,
1314
+ i18n: this.i18n,
1315
+ title: options.previewTitle || this._t('shell.exportSvgPreviewTitle', { label }),
1134
1316
  initialTheme: options.theme || 'current',
1135
1317
  createArtifact: (previewOptions) => this.exportSvg({ label, ...options, ...previewOptions, filename }),
1136
1318
  onClose: () => { this._svgExportPreview = null; },
1137
1319
  onDownload: (artifact) => {
1138
- this._setStatus(`SVG 已导出:${artifact.filename}`, 'ok');
1320
+ this._setStatus(this._t('shell.status.exportedSvg', { filename: artifact.filename }), 'ok');
1139
1321
  options.onDownload?.(artifact);
1140
1322
  },
1141
1323
  });
@@ -1152,13 +1334,13 @@ export class BpmnStudioShell {
1152
1334
  const issues = this.studio.validate();
1153
1335
  const errorCount = issues.filter((issue) => issue.level === 'error').length;
1154
1336
  const warningCount = issues.filter((issue) => issue.level === 'warning').length;
1155
- if (!issues.length) this._setStatus('校验通过:流程结构正常', 'ok');
1337
+ if (!issues.length) this._setStatus(this._t('shell.status.validationPassed'), 'ok');
1156
1338
  else {
1157
1339
  const summary = [
1158
- errorCount ? `${errorCount} 个错误` : null,
1159
- warningCount ? `${warningCount} 个警告` : null,
1340
+ errorCount ? this._t('shell.status.errorCount', { count: errorCount }) : null,
1341
+ warningCount ? this._t('shell.status.warningCount', { count: warningCount }) : null,
1160
1342
  ].filter(Boolean).join(' · ');
1161
- this._setStatus(`校验完成:${summary}`, errorCount ? 'error' : 'warning');
1343
+ this._setStatus(this._t('shell.status.validationSummary', { summary }), errorCount ? 'error' : 'warning');
1162
1344
  }
1163
1345
  const eventIssues = Object.freeze(issues.map((issue) => Object.freeze({ ...issue })));
1164
1346
  const event = Object.freeze({
@@ -1188,7 +1370,7 @@ export class BpmnStudioShell {
1188
1370
  anchor.click();
1189
1371
  anchor.remove();
1190
1372
  setTimeout(() => URL.revokeObjectURL(url), 0);
1191
- this._setStatus('BPMN 文件已导出', 'ok');
1373
+ this._setStatus(this._t('shell.status.exportedBpmn'), 'ok');
1192
1374
  }
1193
1375
 
1194
1376
  _recordCleanup(cleanup) { if (typeof cleanup === 'function') this._cleanups.push(cleanup); }
@@ -1196,6 +1378,7 @@ export class BpmnStudioShell {
1196
1378
  return new BpmnCanvas({
1197
1379
  container,
1198
1380
  studio: this.studio,
1381
+ i18n: this.i18n,
1199
1382
  interactions: this.interactions,
1200
1383
  selectionToolbar: options.selectionToolbar ?? this.slots.selectionToolbar ?? null,
1201
1384
  contextMenu: options.contextMenu ?? this.slots.contextMenu ?? null,
@@ -1214,11 +1397,11 @@ export class BpmnStudioShell {
1214
1397
  this._instances.push(instance); return instance;
1215
1398
  }
1216
1399
  _mountPalette(container, options = {}) {
1217
- const instance = new PalettePanel({ container, studio: this.studio, registry: this.paletteRegistry, interactions: this.interactions, iconRegistry: this.iconRegistry, themeController: this.themeController, ...options });
1400
+ const instance = new PalettePanel({ container, studio: this.studio, registry: this.paletteRegistry, interactions: this.interactions, iconRegistry: this.iconRegistry, themeController: this.themeController, i18n: this.i18n, ...options });
1218
1401
  this._instances.push(instance); return instance;
1219
1402
  }
1220
1403
  _mountProperties(container, options = {}) {
1221
- const instance = new PropertiesPanel({ container, studio: this.studio, registry: this.propertiesRegistry, iconRegistry: this.iconRegistry, themeController: this.themeController, ...options });
1404
+ const instance = new PropertiesPanel({ container, studio: this.studio, registry: this.propertiesRegistry, iconRegistry: this.iconRegistry, themeController: this.themeController, i18n: this.i18n, ...options });
1222
1405
  instance.render(); this._instances.push(instance); return instance;
1223
1406
  }
1224
1407
  _releaseInstance(instance) {