Support i18n

This commit is contained in:
huchenlei
2025-08-10 12:36:40 -04:00
parent 38a77abecb
commit 1e6803fd65
8 changed files with 45 additions and 21 deletions

View File

@@ -41,7 +41,9 @@ const mockCommands: ComfyCommandImpl[] = [
icon: 'pi pi-test',
tooltip: 'Test tooltip',
menubarLabel: 'Other Command',
keybinding: null
keybinding: null,
getTranslatedLabel: () => 'Other Command',
getTranslatedMenubarLabel: () => 'Other Command'
} as ComfyCommandImpl
]

View File

@@ -32,7 +32,8 @@ describe('ShortcutsList', () => {
combo: {
getKeySequences: () => ['Control', 'n']
}
}
},
getTranslatedLabel: () => 'New Workflow'
} as ComfyCommandImpl,
{
id: 'Node.Add',
@@ -42,7 +43,8 @@ describe('ShortcutsList', () => {
combo: {
getKeySequences: () => ['Shift', 'a']
}
}
},
getTranslatedLabel: () => 'Add Node'
} as ComfyCommandImpl,
{
id: 'Queue.Clear',
@@ -52,7 +54,8 @@ describe('ShortcutsList', () => {
combo: {
getKeySequences: () => ['Control', 'Shift', 'c']
}
}
},
getTranslatedLabel: () => 'Clear Queue'
} as ComfyCommandImpl
]
@@ -104,7 +107,8 @@ describe('ShortcutsList', () => {
id: 'No.Keybinding',
label: 'No Keybinding',
category: 'essentials',
keybinding: null
keybinding: null,
getTranslatedLabel: () => 'No Keybinding'
} as ComfyCommandImpl
]
@@ -130,7 +134,8 @@ describe('ShortcutsList', () => {
combo: {
getKeySequences: () => ['Meta', 'ArrowUp', 'Enter', 'Escape', ' ']
}
}
},
getTranslatedLabel: () => 'Special Keys'
} as ComfyCommandImpl
const wrapper = mount(ShortcutsList, {