From fcf08a6dbd01471d8388a57212fdaf88a7e6f95b Mon Sep 17 00:00:00 2001 From: Cyril Date: Tue, 24 Feb 2026 09:13:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90(frontend)=20localize=20SR=20modifi?= =?UTF-8?q?er=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded 'Alt'/'Shift' in SR formatter with i18next labels. Use Option/Alt distinction on Mac like Ctrl/Command. --- src/frontend/src/features/shortcuts/formatLabels.ts | 5 ++++- .../src/features/shortcuts/hooks/useShortcutFormatting.ts | 1 + src/frontend/src/locales/de/rooms.json | 1 + src/frontend/src/locales/en/rooms.json | 1 + src/frontend/src/locales/fr/rooms.json | 1 + src/frontend/src/locales/nl/rooms.json | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/shortcuts/formatLabels.ts b/src/frontend/src/features/shortcuts/formatLabels.ts index 18a0ceea..98123e32 100644 --- a/src/frontend/src/features/shortcuts/formatLabels.ts +++ b/src/frontend/src/features/shortcuts/formatLabels.ts @@ -21,6 +21,7 @@ export const formatShortcutLabelForSR = ( controlLabel, commandLabel, altLabel, + optionLabel, shiftLabel, plusLabel, noShortcutLabel, @@ -28,6 +29,7 @@ export const formatShortcutLabelForSR = ( controlLabel: string commandLabel: string altLabel: string + optionLabel: string shiftLabel: string plusLabel: string noShortcutLabel: string @@ -37,9 +39,10 @@ export const formatShortcutLabelForSR = ( const key = shortcut.key?.toUpperCase() if (!key) return noShortcutLabel const ctrlWord = isMacintosh() ? commandLabel : controlLabel + const altWord = isMacintosh() ? optionLabel : altLabel const parts: string[] = [] if (shortcut.ctrlKey) parts.push(ctrlWord) - if (shortcut.altKey) parts.push(altLabel) + if (shortcut.altKey) parts.push(altWord) if (shortcut.shiftKey) parts.push(shiftLabel) parts.push(key) return parts.join(` ${plusLabel} `) diff --git a/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts b/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts index ba685ce3..1c747da0 100644 --- a/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts +++ b/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts @@ -38,6 +38,7 @@ export const useShortcutFormatting = () => { controlLabel: t('shortcutsPanel.sr.control'), commandLabel: t('shortcutsPanel.sr.command'), altLabel: t('shortcutsPanel.sr.alt'), + optionLabel: t('shortcutsPanel.sr.option'), shiftLabel: t('shortcutsPanel.sr.shift'), plusLabel: t('shortcutsPanel.sr.plus'), noShortcutLabel: t('shortcutsPanel.sr.noShortcut'), diff --git a/src/frontend/src/locales/de/rooms.json b/src/frontend/src/locales/de/rooms.json index 095a9c80..76bdf8de 100644 --- a/src/frontend/src/locales/de/rooms.json +++ b/src/frontend/src/locales/de/rooms.json @@ -620,6 +620,7 @@ "control": "Steuerung", "command": "Befehl", "alt": "Alt", + "option": "Option", "shift": "Umschalt", "plus": "plus", "hold": "Halte {{key}} gedrückt", diff --git a/src/frontend/src/locales/en/rooms.json b/src/frontend/src/locales/en/rooms.json index 4c8e1991..e32fc113 100644 --- a/src/frontend/src/locales/en/rooms.json +++ b/src/frontend/src/locales/en/rooms.json @@ -620,6 +620,7 @@ "control": "Control", "command": "Command", "alt": "Alt", + "option": "Option", "shift": "Shift", "plus": "plus", "hold": "Hold {{key}}", diff --git a/src/frontend/src/locales/fr/rooms.json b/src/frontend/src/locales/fr/rooms.json index 78f48e9b..6aaddddd 100644 --- a/src/frontend/src/locales/fr/rooms.json +++ b/src/frontend/src/locales/fr/rooms.json @@ -620,6 +620,7 @@ "control": "Contrôle", "command": "Commande", "alt": "Alt", + "option": "Option", "shift": "Majuscule", "plus": "plus", "hold": "Maintenir {{key}}", diff --git a/src/frontend/src/locales/nl/rooms.json b/src/frontend/src/locales/nl/rooms.json index 529e516f..f7e778b7 100644 --- a/src/frontend/src/locales/nl/rooms.json +++ b/src/frontend/src/locales/nl/rooms.json @@ -620,6 +620,7 @@ "control": "Control", "command": "Command", "alt": "Alt", + "option": "Option", "shift": "Shift", "plus": "plus", "hold": "Houd {{key}} ingedrukt",