Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(ui): add groupTitle locale key for shortcut group display (#6967)

白熱c66cd360c883
diff --git a/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts b/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
index ccb99d8752..a83f44e374 100644
--- a/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
+++ b/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
@@ -34,6 +34,7 @@ export const MoveDrawingDownShortcutItem: IShortcutItem<IMoveDrawingsCommandPara
id: MoveDocDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-down',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_DOWN,
priority: 100,
preconditions: whenDocDrawingFocused,
@@ -46,6 +47,7 @@ export const MoveDrawingUpShortcutItem: IShortcutItem<IMoveDrawingsCommandParams
id: MoveDocDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-up',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_UP,
priority: 100,
preconditions: whenDocDrawingFocused,
@@ -58,6 +60,7 @@ export const MoveDrawingLeftShortcutItem: IShortcutItem<IMoveDrawingsCommandPara
id: MoveDocDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-left',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_LEFT,
priority: 100,
preconditions: whenDocDrawingFocused,
@@ -70,6 +73,7 @@ export const MoveDrawingRightShortcutItem: IShortcutItem<IMoveDrawingsCommandPar
id: MoveDocDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-right',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_RIGHT,
priority: 100,
preconditions: whenDocDrawingFocused,
@@ -81,6 +85,7 @@ export const DeleteDrawingsShortcutItem: IShortcutItem = {
id: DeleteDocDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-delete',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
// when focusing on any other input tag do not trigger this shortcut
preconditions: whenDocDrawingFocused,
binding: KeyCode.DELETE,
diff --git a/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts b/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
index b930045e03..2e1875d652 100644
--- a/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
+++ b/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts
@@ -36,6 +36,7 @@ export const MoveDrawingDownShortcutItem: IShortcutItem<IMoveDrawingsCommandPara
id: MoveDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-down',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_DOWN,
priority: 100,
preconditions: whenSheetDrawingFocused,
@@ -48,6 +49,7 @@ export const MoveDrawingUpShortcutItem: IShortcutItem<IMoveDrawingsCommandParams
id: MoveDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-up',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_UP,
priority: 100,
preconditions: whenSheetDrawingFocused,
@@ -60,6 +62,7 @@ export const MoveDrawingLeftShortcutItem: IShortcutItem<IMoveDrawingsCommandPara
id: MoveDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-left',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_LEFT,
priority: 100,
preconditions: whenSheetDrawingFocused,
@@ -72,6 +75,7 @@ export const MoveDrawingRightShortcutItem: IShortcutItem<IMoveDrawingsCommandPar
id: MoveDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-move-right',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
binding: KeyCode.ARROW_RIGHT,
priority: 100,
preconditions: whenSheetDrawingFocused,
@@ -83,6 +87,7 @@ export const DeleteDrawingsShortcutItem: IShortcutItem = {
id: DeleteDrawingsCommand.id,
description: 'drawing-ui.shortcut.drawing-delete',
group: '4_drawing-view',
+ groupTitle: 'sheets-drawing-ui.shortcut.drawing-view',
priority: 100,
// when focusing on any other input tag do not trigger this shortcut
preconditions: whenSheetDrawingFocused,
diff --git a/packages/sheets-drawing-ui/src/locale/ar-SA.ts b/packages/sheets-drawing-ui/src/locale/ar-SA.ts
index 29829b15c5..3dea334ba6 100644
--- a/packages/sheets-drawing-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-drawing-ui/src/locale/ar-SA.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'النطاق محمي، وليس لديك إذن التحرير. للتحرير، يرجى التواصل مع المنشئ.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/ca-ES.ts b/packages/sheets-drawing-ui/src/locale/ca-ES.ts
index 6b16a1c324..a359a9f2f1 100644
--- a/packages/sheets-drawing-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-drawing-ui/src/locale/ca-ES.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'L\'interval està protegit i no teniu permís d\'edició. Per editar, contacteu amb el creador.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/de-DE.ts b/packages/sheets-drawing-ui/src/locale/de-DE.ts
index d233482cce..deae82c90e 100644
--- a/packages/sheets-drawing-ui/src/locale/de-DE.ts
+++ b/packages/sheets-drawing-ui/src/locale/de-DE.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Der Bereich ist geschützt, und Sie haben keine Bearbeitungsberechtigung. Um zu bearbeiten, wenden Sie sich bitte an den Ersteller.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/en-US.ts b/packages/sheets-drawing-ui/src/locale/en-US.ts
index 49618b7987..05b8e8af25 100644
--- a/packages/sheets-drawing-ui/src/locale/en-US.ts
+++ b/packages/sheets-drawing-ui/src/locale/en-US.ts
@@ -71,6 +71,9 @@ const locale = {
editErr: 'The range is protected, and you do not have edit permission. To edit, please contact the creator.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/es-ES.ts b/packages/sheets-drawing-ui/src/locale/es-ES.ts
index 631c43ea04..c87f8fb11b 100644
--- a/packages/sheets-drawing-ui/src/locale/es-ES.ts
+++ b/packages/sheets-drawing-ui/src/locale/es-ES.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'El rango está protegido y no tienes permiso de edición. Para editar, contacta al creador.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/fa-IR.ts b/packages/sheets-drawing-ui/src/locale/fa-IR.ts
index 5c9854c257..72d0b3243c 100644
--- a/packages/sheets-drawing-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-drawing-ui/src/locale/fa-IR.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'محدوده محافظت شده است و شما مجوز ویرایش را ندارید. برای ویرایش، لطفا با سازنده تماس بگیرید.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/fr-FR.ts b/packages/sheets-drawing-ui/src/locale/fr-FR.ts
index 6c167fa54e..7fed9b1df3 100644
--- a/packages/sheets-drawing-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-drawing-ui/src/locale/fr-FR.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'La plage est protégée, et vous n\'avez pas la permission de modifier. Pour modifier, veuillez contacter le créateur.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/id-ID.ts b/packages/sheets-drawing-ui/src/locale/id-ID.ts
index 104545b118..7f2f8fc434 100644
--- a/packages/sheets-drawing-ui/src/locale/id-ID.ts
+++ b/packages/sheets-drawing-ui/src/locale/id-ID.ts
@@ -60,8 +60,8 @@ const locale: typeof enUS = {
'drawing-anchor': {
title: 'Properti Jangkar',
both: 'Pindah dan ukur bersama sel',
- position: "Pindah tapi tidak ukur bersama sel",
- none: "Jangan pindah atau ukur bersama sel",
+ position: 'Pindah tapi tidak ukur bersama sel',
+ none: 'Jangan pindah atau ukur bersama sel',
},
'cell-image': {
pasteTitle: 'Tempel sebagai gambar sel',
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Rentang ini dilindungi, dan Anda tidak memiliki izin edit. Untuk mengedit, silakan hubungi pembuatnya.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/it-IT.ts b/packages/sheets-drawing-ui/src/locale/it-IT.ts
index 2e51fa7f8e..e0680ae8e4 100644
--- a/packages/sheets-drawing-ui/src/locale/it-IT.ts
+++ b/packages/sheets-drawing-ui/src/locale/it-IT.ts
@@ -60,19 +60,22 @@ const locale: typeof enUS = {
'drawing-anchor': {
title: 'Proprietà ancoraggio',
both: 'Sposta e ridimensiona con le celle',
- position: "Sposta ma non ridimensionare con le celle",
- none: "Non spostare né ridimensionare con le celle",
+ position: 'Sposta ma non ridimensionare con le celle',
+ none: 'Non spostare né ridimensionare con le celle',
},
'cell-image': {
pasteTitle: 'Incolla come immagine cella',
pasteContent: "L'incollaggio di un'immagine cella sovrascriverà il contenuto esistente della cella, continuare con l'incollaggio",
- pasteError: "Copia e incolla di immagine cella non supportato in questa unità",
+ pasteError: 'Copia e incolla di immagine cella non supportato in questa unità',
},
permission: {
dialog: {
editErr: "L'intervallo è protetto e non hai l'autorizzazione di modifica. Per modificare, contatta il creatore.",
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/ja-JP.ts b/packages/sheets-drawing-ui/src/locale/ja-JP.ts
index a37d406a19..f33936389b 100644
--- a/packages/sheets-drawing-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-drawing-ui/src/locale/ja-JP.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'この範囲は保護されており、編集権限がありません。編集するには作成者に連絡してください。',
},
},
+ shortcut: {
+ 'drawing-view': '図形表示',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/ko-KR.ts b/packages/sheets-drawing-ui/src/locale/ko-KR.ts
index b5a8011230..8158a75545 100644
--- a/packages/sheets-drawing-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-drawing-ui/src/locale/ko-KR.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: '해당 범위는 보호되어 있어 편집 권한이 없습니다. 편집하려면 작성자에게 문의하세요.',
},
},
+ shortcut: {
+ 'drawing-view': '그리기 보기',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/pl-PL.ts b/packages/sheets-drawing-ui/src/locale/pl-PL.ts
index 0bf454c724..df3ee1e661 100644
--- a/packages/sheets-drawing-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-drawing-ui/src/locale/pl-PL.ts
@@ -60,8 +60,8 @@ const locale: typeof enUS = {
'drawing-anchor': {
title: 'Właściwości kotwicy',
both: 'Przesuwaj i zmieniaj rozmiar razem z komórkami',
- position: "Przesuwaj, ale nie zmieniaj rozmiaru razem z komórkami",
- none: "Nie przesuwaj ani nie zmieniaj rozmiaru razem z komórkami",
+ position: 'Przesuwaj, ale nie zmieniaj rozmiaru razem z komórkami',
+ none: 'Nie przesuwaj ani nie zmieniaj rozmiaru razem z komórkami',
},
'cell-image': {
pasteTitle: 'Wklej jako obraz w komórce',
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Zakres jest chroniony i nie masz uprawnień do edycji. Aby edytować, skontaktuj się z twórcą.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/pt-BR.ts b/packages/sheets-drawing-ui/src/locale/pt-BR.ts
index 3ea3325215..096e7404bf 100644
--- a/packages/sheets-drawing-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-drawing-ui/src/locale/pt-BR.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'O intervalo está protegido e você não tem permissão de edição. Para editar, entre em contato com o criador.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/ru-RU.ts b/packages/sheets-drawing-ui/src/locale/ru-RU.ts
index 93ae069d19..5a2f49094a 100644
--- a/packages/sheets-drawing-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-drawing-ui/src/locale/ru-RU.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Диапазон защищен, и у вас нет разрешения на редактирование. Для редактирования свяжитесь с создателем.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/sk-SK.ts b/packages/sheets-drawing-ui/src/locale/sk-SK.ts
index cdef384567..200e070d91 100644
--- a/packages/sheets-drawing-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-drawing-ui/src/locale/sk-SK.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Rozsah je chránený a nemáte oprávnenie na úpravy. Ak chcete upravovať, kontaktujte autora.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/vi-VN.ts b/packages/sheets-drawing-ui/src/locale/vi-VN.ts
index b79729787a..01eff53741 100644
--- a/packages/sheets-drawing-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-drawing-ui/src/locale/vi-VN.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: 'Phạm vi này đã được bảo vệ, hiện không có quyền chỉnh sửa. Nếu cần chỉnh sửa, vui lòng liên hệ với người tạo.',
},
},
+ shortcut: {
+ 'drawing-view': 'Drawing View',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/zh-CN.ts b/packages/sheets-drawing-ui/src/locale/zh-CN.ts
index c7bfc3499d..58365b5ef2 100644
--- a/packages/sheets-drawing-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-drawing-ui/src/locale/zh-CN.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: '该范围已被保护,目前无编辑权限。如需编辑,请联系创建者。',
},
},
+ shortcut: {
+ 'drawing-view': '绘图视图',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/zh-HK.ts b/packages/sheets-drawing-ui/src/locale/zh-HK.ts
index 42d07a53bb..a697664bfb 100644
--- a/packages/sheets-drawing-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-drawing-ui/src/locale/zh-HK.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: '該範圍已被保護,目前無編輯權限。如需編輯,請聯絡創建者。 ',
},
},
+ shortcut: {
+ 'drawing-view': '繪圖檢視',
+ },
},
};
diff --git a/packages/sheets-drawing-ui/src/locale/zh-TW.ts b/packages/sheets-drawing-ui/src/locale/zh-TW.ts
index 42d07a53bb..a697664bfb 100644
--- a/packages/sheets-drawing-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-drawing-ui/src/locale/zh-TW.ts
@@ -73,6 +73,9 @@ const locale: typeof enUS = {
editErr: '該範圍已被保護,目前無編輯權限。如需編輯,請聯絡創建者。 ',
},
},
+ shortcut: {
+ 'drawing-view': '繪圖檢視',
+ },
},
};
diff --git a/packages/sheets-filter-ui/src/controllers/sheets-filter.shortcut.ts b/packages/sheets-filter-ui/src/controllers/sheets-filter.shortcut.ts
index a576b51ba3..9b2137d2df 100644
--- a/packages/sheets-filter-ui/src/controllers/sheets-filter.shortcut.ts
+++ b/packages/sheets-filter-ui/src/controllers/sheets-filter.shortcut.ts
@@ -25,4 +25,5 @@ export const SmartToggleFilterShortcut: IShortcutItem = {
description: 'sheets-filter-ui.shortcut.smart-toggle-filter',
preconditions: whenSheetEditorFocused,
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
};
diff --git a/packages/sheets-formula-ui/src/controllers/shortcuts/quick-sum.shortcut.ts b/packages/sheets-formula-ui/src/controllers/shortcuts/quick-sum.shortcut.ts
index 665ce254d9..0113c6a035 100644
--- a/packages/sheets-formula-ui/src/controllers/shortcuts/quick-sum.shortcut.ts
+++ b/packages/sheets-formula-ui/src/controllers/shortcuts/quick-sum.shortcut.ts
@@ -26,4 +26,5 @@ export const QuickSumShortcut: IShortcutItem = {
mac: MetaKeys.CTRL_COMMAND | MetaKeys.ALT | KeyCode.EQUAL,
description: 'sheets-formula-ui.shortcut.quick-sum',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
};
diff --git a/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts b/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
index 7f501456df..1f8638bf56 100644
--- a/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
+++ b/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
@@ -78,6 +78,7 @@ export const StartEditWithF2Shortcut: IShortcutItem = {
binding: KeyCode.F2,
description: 'sheets-ui.shortcut.sheet.start-editing',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: whenSheetEditorFocused,
staticParameters: {
visible: true,
@@ -91,6 +92,7 @@ export const RepeatLastActionShortcut: IShortcutItem = {
binding: KeyCode.F4,
description: 'sheets-ui.shortcut.sheet.repeat-last-action',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: whenSheetEditorFocused,
};
@@ -99,6 +101,7 @@ export const EditorCursorEnterShortcut: IShortcutItem = {
binding: KeyCode.ENTER,
description: 'sheets-ui.shortcut.sheet.toggle-editing',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenEditorDidNotInputFormulaActivated(contextService),
staticParameters: {
visible: false,
@@ -123,6 +126,7 @@ export const EditorCursorEscShortcut: IShortcutItem = {
binding: KeyCode.ESC,
description: 'sheets-ui.shortcut.sheet.abort-editing',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenEditorDidNotInputFormulaActivated(contextService),
staticParameters: {
visible: false,
@@ -147,6 +151,7 @@ export const EditorBreakLineShortcut: IShortcutItem = {
id: BreakLineCommand.id,
description: 'sheets-ui.shortcut.sheet.break-line',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetEditorActivated(contextService),
binding: KeyCode.ENTER | MetaKeys.ALT,
};
@@ -176,6 +181,7 @@ export const EditorDeleteLeftShortcutInActive: IShortcutItem = {
id: SetCellEditVisibleOperation.id,
description: 'sheets-ui.shortcut.sheet.delete-and-start-editing',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetEditorFocused(contextService) && !whenFormulaEditorFocused(contextService),
binding: KeyCode.BACKSPACE,
staticParameters: {
diff --git a/packages/sheets-ui/src/controllers/shortcuts/selection.shortcut.ts b/packages/sheets-ui/src/controllers/shortcuts/selection.shortcut.ts
index df78d7de56..c8c67e0fc9 100644
--- a/packages/sheets-ui/src/controllers/shortcuts/selection.shortcut.ts
+++ b/packages/sheets-ui/src/controllers/shortcuts/selection.shortcut.ts
@@ -36,6 +36,7 @@ export const MoveSelectionDownShortcutItem: IShortcutItem<IMoveSelectionCommandP
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-below-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_DOWN,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -48,6 +49,7 @@ export const MoveSelectionUpShortcutItem: IShortcutItem<IMoveSelectionCommandPar
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-up-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_UP,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -60,6 +62,7 @@ export const MoveSelectionLeftShortcutItem: IShortcutItem<IMoveSelectionCommandP
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-left-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_LEFT,
priority: 100,
preconditions: whenSheetEditorFocusedAndFxNotFocused,
@@ -72,6 +75,7 @@ export const MoveSelectionRightShortcutItem: IShortcutItem<IMoveSelectionCommand
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-right-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_RIGHT,
priority: 100,
preconditions: whenSheetEditorFocusedAndFxNotFocused,
@@ -84,6 +88,7 @@ export const MoveSelectionTabShortcutItem: IShortcutItem<IMoveSelectionEnterAndT
id: MoveSelectionEnterAndTabCommand.id,
description: 'sheets-ui.shortcut.sheet.select-next-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.TAB,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -97,6 +102,7 @@ export const MoveSelectionTabLeftShortcutItem: IShortcutItem<IMoveSelectionEnter
id: MoveSelectionEnterAndTabCommand.id,
description: 'sheets-ui.shortcut.sheet.select-previous-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.TAB | MetaKeys.SHIFT,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -110,6 +116,7 @@ export const MoveSelectionEnterShortcutItem: IShortcutItem<IMoveSelectionEnterAn
id: MoveSelectionEnterAndTabCommand.id,
description: 'sheets-ui.shortcut.sheet.select-below-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ENTER,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -123,6 +130,7 @@ export const MoveSelectionEnterUpShortcutItem: IShortcutItem<IMoveSelectionEnter
id: MoveSelectionEnterAndTabCommand.id,
description: 'sheets-ui.shortcut.sheet.select-up-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ENTER | MetaKeys.SHIFT,
priority: 100,
preconditions: whenSheetEditorFocused,
@@ -150,6 +158,7 @@ export const MoveSelectionEndDownShortcutItem: IShortcutItem<IMoveSelectionComma
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-below-value-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_DOWN | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -162,6 +171,7 @@ export const MoveSelectionEndUpShortcutItem: IShortcutItem<IMoveSelectionCommand
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-up-value-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_UP | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -174,6 +184,7 @@ export const MoveSelectionEndLeftShortcutItem: IShortcutItem<IMoveSelectionComma
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-left-value-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_LEFT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -186,6 +197,7 @@ export const MoveSelectionEndRightShortcutItem: IShortcutItem<IMoveSelectionComm
id: MoveSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.select-right-value-cell',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_RIGHT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -198,6 +210,7 @@ export const ExpandSelectionDownShortcutItem: IShortcutItem<IExpandSelectionComm
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-down',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_DOWN | MetaKeys.SHIFT,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -209,6 +222,7 @@ export const ExpandSelectionUpShortcutItem: IShortcutItem<IExpandSelectionComman
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-up',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_UP | MetaKeys.SHIFT,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -220,6 +234,7 @@ export const ExpandSelectionLeftShortcutItem: IShortcutItem<IExpandSelectionComm
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-left',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_LEFT | MetaKeys.SHIFT,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -231,6 +246,7 @@ export const ExpandSelectionRightShortcutItem: IShortcutItem<IExpandSelectionCom
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-right',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_RIGHT | MetaKeys.SHIFT,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -244,6 +260,7 @@ export const ExpandSelectionEndDownShortcutItem: IShortcutItem<IExpandSelectionC
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-to-below-gap',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_DOWN | MetaKeys.SHIFT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -256,6 +273,7 @@ export const ExpandSelectionEndUpShortcutItem: IShortcutItem<IExpandSelectionCom
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-to-up-gap',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_UP | MetaKeys.SHIFT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -268,6 +286,7 @@ export const ExpandSelectionEndLeftShortcutItem: IShortcutItem<IExpandSelectionC
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-to-left-gap',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_LEFT | MetaKeys.SHIFT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -280,6 +299,7 @@ export const ExpandSelectionEndRightShortcutItem: IShortcutItem<IExpandSelection
id: ExpandSelectionCommand.id,
description: 'sheets-ui.shortcut.sheet.expand-selection-to-right-gap',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.ARROW_RIGHT | MetaKeys.SHIFT | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
@@ -292,6 +312,7 @@ export const SelectAllShortcutItem: IShortcutItem<ISelectAllCommandParams> = {
id: SelectAllCommand.id,
description: 'sheets-ui.shortcut.sheet.select-all',
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
binding: KeyCode.A | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
staticParameters: {
diff --git a/packages/sheets-ui/src/controllers/shortcuts/style.shortcut.ts b/packages/sheets-ui/src/controllers/shortcuts/style.shortcut.ts
index e3a64228c9..87e236aaf3 100644
--- a/packages/sheets-ui/src/controllers/shortcuts/style.shortcut.ts
+++ b/packages/sheets-ui/src/controllers/shortcuts/style.shortcut.ts
@@ -29,6 +29,7 @@ export const SetBoldShortcutItem: IShortcutItem = {
id: SetRangeBoldCommand.id,
description: 'sheets-ui.shortcut.sheet.set-bold',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
binding: KeyCode.B | MetaKeys.CTRL_COMMAND,
};
@@ -37,6 +38,7 @@ export const SetItalicShortcutItem: IShortcutItem = {
id: SetRangeItalicCommand.id,
description: 'sheets-ui.shortcut.sheet.set-italic',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
binding: KeyCode.I | MetaKeys.CTRL_COMMAND,
};
@@ -45,6 +47,7 @@ export const SetUnderlineShortcutItem: IShortcutItem = {
id: SetRangeUnderlineCommand.id,
description: 'sheets-ui.shortcut.sheet.set-underline',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
binding: KeyCode.U | MetaKeys.CTRL_COMMAND,
};
@@ -53,6 +56,7 @@ export const SetStrikeThroughShortcutItem: IShortcutItem = {
id: SetRangeStrickThroughCommand.id,
description: 'sheets-ui.shortcut.sheet.set-strike-through',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
binding: KeyCode.X | MetaKeys.SHIFT | MetaKeys.CTRL_COMMAND,
};
diff --git a/packages/sheets-ui/src/controllers/shortcuts/view.shortcut.ts b/packages/sheets-ui/src/controllers/shortcuts/view.shortcut.ts
index 3b37c86648..d897435a4a 100644
--- a/packages/sheets-ui/src/controllers/shortcuts/view.shortcut.ts
+++ b/packages/sheets-ui/src/controllers/shortcuts/view.shortcut.ts
@@ -25,6 +25,7 @@ export const ZoomInShortcutItem: IShortcutItem = {
description: 'sheets-ui.shortcut.sheet.zoom-in',
binding: KeyCode.EQUAL | MetaKeys.CTRL_COMMAND,
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
preconditions: whenSheetEditorFocused,
priority: 1,
staticParameters: {
@@ -41,6 +42,7 @@ export const ZoomOutShortcutItem: IShortcutItem = {
description: 'sheets-ui.shortcut.sheet.zoom-out',
binding: KeyCode.MINUS | MetaKeys.CTRL_COMMAND,
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
preconditions: whenSheetEditorFocused,
priority: 1,
staticParameters: {
@@ -58,6 +60,7 @@ export const ResetZoomShortcutItem: IShortcutItem = {
binding: KeyCode.Digit0 | MetaKeys.CTRL_COMMAND,
preconditions: whenSheetEditorFocused,
group: '3_sheet-view',
+ groupTitle: 'sheets-ui.shortcut.sheet-view',
priority: 1,
staticParameters: {
reset: true,
diff --git a/packages/sheets-ui/src/locale/ar-SA.ts b/packages/sheets-ui/src/locale/ar-SA.ts
index 2c53f8e6ad..2705fb3e00 100644
--- a/packages/sheets-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-ui/src/locale/ar-SA.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'تم النسخ',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'تكبير',
'zoom-out': 'تصغير',
diff --git a/packages/sheets-ui/src/locale/ca-ES.ts b/packages/sheets-ui/src/locale/ca-ES.ts
index 97ab1f4b8d..33b3db197d 100644
--- a/packages/sheets-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-ui/src/locale/ca-ES.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Copiat',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Apropar',
'zoom-out': 'Allunyar',
diff --git a/packages/sheets-ui/src/locale/de-DE.ts b/packages/sheets-ui/src/locale/de-DE.ts
index b81dc1dc86..7569b12332 100644
--- a/packages/sheets-ui/src/locale/de-DE.ts
+++ b/packages/sheets-ui/src/locale/de-DE.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Kopiert',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Vergrößern',
'zoom-out': 'Verkleinern',
diff --git a/packages/sheets-ui/src/locale/en-US.ts b/packages/sheets-ui/src/locale/en-US.ts
index 357898515b..1d7d485baa 100644
--- a/packages/sheets-ui/src/locale/en-US.ts
+++ b/packages/sheets-ui/src/locale/en-US.ts
@@ -276,6 +276,8 @@ const locale = {
copied: 'Copied',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Zoom in',
'zoom-out': 'Zoom out',
diff --git a/packages/sheets-ui/src/locale/es-ES.ts b/packages/sheets-ui/src/locale/es-ES.ts
index 3f609625ff..fca24b724a 100644
--- a/packages/sheets-ui/src/locale/es-ES.ts
+++ b/packages/sheets-ui/src/locale/es-ES.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Copiado',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Acercar',
'zoom-out': 'Alejar',
diff --git a/packages/sheets-ui/src/locale/fa-IR.ts b/packages/sheets-ui/src/locale/fa-IR.ts
index 4fc5653201..fbcb2ceb56 100644
--- a/packages/sheets-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-ui/src/locale/fa-IR.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'کپی شد',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'بزرگنمایی',
'zoom-out': 'کوچکنمایی',
diff --git a/packages/sheets-ui/src/locale/fr-FR.ts b/packages/sheets-ui/src/locale/fr-FR.ts
index 466d99683a..c1145d8bc9 100644
--- a/packages/sheets-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-ui/src/locale/fr-FR.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Copié',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Zoom avant',
'zoom-out': 'Zoom arrière',
diff --git a/packages/sheets-ui/src/locale/id-ID.ts b/packages/sheets-ui/src/locale/id-ID.ts
index 11084efd74..c969304966 100644
--- a/packages/sheets-ui/src/locale/id-ID.ts
+++ b/packages/sheets-ui/src/locale/id-ID.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Tersalin',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Perbesar',
'zoom-out': 'Perkecil',
diff --git a/packages/sheets-ui/src/locale/it-IT.ts b/packages/sheets-ui/src/locale/it-IT.ts
index 196354dc41..3d9f852be9 100644
--- a/packages/sheets-ui/src/locale/it-IT.ts
+++ b/packages/sheets-ui/src/locale/it-IT.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Copiato',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Aumenta zoom',
'zoom-out': 'Diminuisci zoom',
diff --git a/packages/sheets-ui/src/locale/ja-JP.ts b/packages/sheets-ui/src/locale/ja-JP.ts
index c479ccf3ad..67c80acc10 100644
--- a/packages/sheets-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-ui/src/locale/ja-JP.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'コピーしました',
},
shortcut: {
+ 'sheet-view': 'シート表示',
+ 'sheet-edit': 'シート編集',
sheet: {
'zoom-in': '拡大',
'zoom-out': '縮小',
diff --git a/packages/sheets-ui/src/locale/ko-KR.ts b/packages/sheets-ui/src/locale/ko-KR.ts
index dcccb6dd69..c5030da3e8 100644
--- a/packages/sheets-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-ui/src/locale/ko-KR.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: '복사됨',
},
shortcut: {
+ 'sheet-view': '시트 보기',
+ 'sheet-edit': '시트 편집',
sheet: {
'zoom-in': '확대',
'zoom-out': '축소',
diff --git a/packages/sheets-ui/src/locale/pl-PL.ts b/packages/sheets-ui/src/locale/pl-PL.ts
index 6671a8760e..1f7fdb9ffa 100644
--- a/packages/sheets-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-ui/src/locale/pl-PL.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Skopiowano',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Powiększ',
'zoom-out': 'Pomniejsz',
diff --git a/packages/sheets-ui/src/locale/pt-BR.ts b/packages/sheets-ui/src/locale/pt-BR.ts
index 346871dd2c..15207c6964 100644
--- a/packages/sheets-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-ui/src/locale/pt-BR.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Copiado',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Aumentar zoom',
'zoom-out': 'Diminuir zoom',
diff --git a/packages/sheets-ui/src/locale/ru-RU.ts b/packages/sheets-ui/src/locale/ru-RU.ts
index c22088f2eb..72037e488a 100644
--- a/packages/sheets-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-ui/src/locale/ru-RU.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Скопировано',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Увеличить',
'zoom-out': 'Уменьшить',
diff --git a/packages/sheets-ui/src/locale/sk-SK.ts b/packages/sheets-ui/src/locale/sk-SK.ts
index c7b4009d98..30d05315b9 100644
--- a/packages/sheets-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-ui/src/locale/sk-SK.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Skopírované',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Priblížiť',
'zoom-out': 'Oddialiť',
diff --git a/packages/sheets-ui/src/locale/vi-VN.ts b/packages/sheets-ui/src/locale/vi-VN.ts
index e294348b5a..157a0fc75e 100644
--- a/packages/sheets-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-ui/src/locale/vi-VN.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: 'Đã sao chép',
},
shortcut: {
+ 'sheet-view': 'Sheet View',
+ 'sheet-edit': 'Sheet Edit',
sheet: {
'zoom-in': 'Phóng to',
'zoom-out': 'Thu nhỏ',
diff --git a/packages/sheets-ui/src/locale/zh-CN.ts b/packages/sheets-ui/src/locale/zh-CN.ts
index 026c4fc0a4..9b873abade 100644
--- a/packages/sheets-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-ui/src/locale/zh-CN.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: '已复制',
},
shortcut: {
+ 'sheet-view': '工作表视图',
+ 'sheet-edit': '工作表编辑',
sheet: {
'zoom-in': '放大',
'zoom-out': '缩小',
diff --git a/packages/sheets-ui/src/locale/zh-HK.ts b/packages/sheets-ui/src/locale/zh-HK.ts
index b42ba8fefb..559bd3db97 100644
--- a/packages/sheets-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-ui/src/locale/zh-HK.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: '已複製',
},
shortcut: {
+ 'sheet-view': '工作表檢視',
+ 'sheet-edit': '工作表編輯',
sheet: {
'zoom-in': '放大',
'zoom-out': '縮小',
diff --git a/packages/sheets-ui/src/locale/zh-TW.ts b/packages/sheets-ui/src/locale/zh-TW.ts
index b42ba8fefb..559bd3db97 100644
--- a/packages/sheets-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-ui/src/locale/zh-TW.ts
@@ -278,6 +278,8 @@ const locale: typeof enUS = {
copied: '已複製',
},
shortcut: {
+ 'sheet-view': '工作表檢視',
+ 'sheet-edit': '工作表編輯',
sheet: {
'zoom-in': '放大',
'zoom-out': '縮小',
diff --git a/packages/sheets-zen-editor/src/controllers/shortcuts/zen-editor.shortcut.ts b/packages/sheets-zen-editor/src/controllers/shortcuts/zen-editor.shortcut.ts
index 368fb39ad5..83d2a9d525 100644
--- a/packages/sheets-zen-editor/src/controllers/shortcuts/zen-editor.shortcut.ts
+++ b/packages/sheets-zen-editor/src/controllers/shortcuts/zen-editor.shortcut.ts
@@ -24,6 +24,7 @@ export const ZenEditorConfirmShortcut: IShortcutItem = {
id: ConfirmZenEditCommand.id,
description: 'sheets-zen-editor.shortcut.sheet.zen-edit-confirm',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenZenEditorActivated(contextService),
binding: KeyCode.ENTER | MetaKeys.ALT,
};
@@ -32,6 +33,7 @@ export const ZenEditorCancelShortcut: IShortcutItem = {
id: CancelZenEditCommand.id,
description: 'sheets-zen-editor.shortcut.sheet.zen-edit-cancel',
group: '4_sheet-edit',
+ groupTitle: 'sheets-ui.shortcut.sheet-edit',
preconditions: (contextService) => whenZenEditorActivated(contextService),
binding: KeyCode.ESC,
};
diff --git a/packages/ui/src/controllers/shared-shortcut.controller.ts b/packages/ui/src/controllers/shared-shortcut.controller.ts
index 7c83a331ea..fcf6783d3e 100644
--- a/packages/ui/src/controllers/shared-shortcut.controller.ts
+++ b/packages/ui/src/controllers/shared-shortcut.controller.ts
@@ -41,6 +41,7 @@ export const CopyShortcutItem: IShortcutItem = {
id: CopyCommand.id,
description: 'ui.shortcut.copy',
group: '1_common-edit',
+ groupTitle: 'ui.common-edit',
binding: KeyCode.C | MetaKeys.CTRL_COMMAND,
preconditions: whenEditorFocused,
};
@@ -49,6 +50,7 @@ export const CutShortcutItem: IShortcutItem = {
id: CutCommand.id,
description: 'ui.shortcut.cut',
group: '1_common-edit',
+ groupTitle: 'ui.common-edit',
binding: KeyCode.X | MetaKeys.CTRL_COMMAND,
preconditions: whenEditorFocused,
};
@@ -60,6 +62,7 @@ export const OnlyDisplayPasteShortcutItem: IShortcutItem = {
id: PasteCommand.id,
description: 'ui.shortcut.paste',
group: '1_common-edit',
+ groupTitle: 'ui.common-edit',
binding: KeyCode.V | MetaKeys.CTRL_COMMAND,
preconditions: () => false,
};
@@ -78,6 +81,7 @@ export const UndoShortcutItem: IShortcutItem = {
id: UndoCommand.id,
description: 'ui.shortcut.undo',
group: '1_common-edit',
+ groupTitle: 'ui.common-edit',
binding: KeyCode.Z | MetaKeys.CTRL_COMMAND,
preconditions: whenEditorFocusedButNotCellEditor,
};
@@ -86,6 +90,7 @@ export const RedoShortcutItem: IShortcutItem = {
id: RedoCommand.id,
description: 'ui.shortcut.redo',
group: '1_common-edit',
+ groupTitle: 'ui.common-edit',
binding: KeyCode.Y | MetaKeys.CTRL_COMMAND,
preconditions: whenEditorFocusedButNotCellEditor,
};
diff --git a/packages/ui/src/controllers/shortcut-display/shortcut-panel.controller.ts b/packages/ui/src/controllers/shortcut-display/shortcut-panel.controller.ts
index 6f2c50d8b4..b2eaeda566 100644
--- a/packages/ui/src/controllers/shortcut-display/shortcut-panel.controller.ts
+++ b/packages/ui/src/controllers/shortcut-display/shortcut-panel.controller.ts
@@ -31,6 +31,7 @@ const ToggleShortcutPanelShortcut: IShortcutItem = {
binding: MetaKeys.CTRL_COMMAND | KeyCode.BACK_SLASH,
description: 'ui.shortcut.shortcut-panel',
group: '10_global-shortcut',
+ groupTitle: 'ui.global-shortcut',
};
/**
diff --git a/packages/ui/src/services/shortcut/shortcut.service.ts b/packages/ui/src/services/shortcut/shortcut.service.ts
index 4af1c1e0ac..79488fb67d 100644
--- a/packages/ui/src/services/shortcut/shortcut.service.ts
+++ b/packages/ui/src/services/shortcut/shortcut.service.ts
@@ -72,6 +72,15 @@ export interface IShortcutItem<P extends object = object> {
*/
group?: string;
+ /**
+ * The locale key for the group title displayed in the shortcut panel.
+ * If not specified, the group name (without the sequence prefix) will be used as the locale key.
+ * It supports dot-notation paths for namespaced locale keys.
+ *
+ * @example { groupTitle: 'ui.global-shortcut' }
+ */
+ groupTitle?: string;
+
/**
* Static parameters of this shortcut. Would be send to {@link ICommandService.executeCommand} as the second
* parameter when the corresponding command is executed.
diff --git a/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx b/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
index 7469557be1..95104421fa 100644
--- a/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
+++ b/packages/ui/src/views/components/shortcut-panel/ShortcutPanel.tsx
@@ -15,7 +15,6 @@
*/
import { dedupeBy, LocaleService } from '@univerjs/core';
-
import { clsx, divideYClassName, KBD } from '@univerjs/design';
import { useCallback, useEffect, useState } from 'react';
import { IShortcutService } from '../../../services/shortcut/shortcut.service';
@@ -46,6 +45,8 @@ export function ShortcutPanel() {
const shortcutGroups = new Map<string, IRenderShortcutItem[]>();
const shortcuts = shortcutService.getAllShortcuts().filter((item) => !!item.group);
+ const groupTitles = new Map<string, string>();
+
for (const shortcut of shortcuts) {
const group = shortcut.group!;
const shortcutItem: IRenderShortcutItem = {
@@ -53,10 +54,18 @@ export function ShortcutPanel() {
shortcut: shortcutService.getShortcutDisplay(shortcut),
};
- if (!/\d+_[a-zA-Z0-9]/.test(group)) {
+ if (!/^\d+_/.test(group)) {
throw new Error(`[ShortcutPanel]: Invalid shortcut group: ${group}!`);
}
+ if (!shortcut.groupTitle) {
+ throw new Error(`[ShortcutPanel]: Shortcut group "${group}" must provide a groupTitle!`);
+ }
+
+ if (!groupTitles.has(group)) {
+ groupTitles.set(group, shortcut.groupTitle);
+ }
+
if (!shortcutGroups.has(group)) {
shortcutGroups.set(group, []);
}
@@ -67,11 +76,11 @@ export function ShortcutPanel() {
const toRender = Array.from(shortcutGroups.entries())
.map(([name, items]) => {
const groupSequence = name.split('_')[0];
- const groupName = name.slice(groupSequence.length + 1);
+ const localeKey = groupTitles.get(name)!;
return {
sequence: +groupSequence,
- name: localeService.t(groupName),
+ name: localeService.t(localeKey),
items: dedupeBy(items, (item) => item.title + item.shortcut),
};
})