From 7bf623f6542bb41a539ba6b4df14b4917d15201e Mon Sep 17 00:00:00 2001 From: Cyril Date: Tue, 24 Feb 2026 09:02:40 +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' and 'Shift' in the SR shortcut --- CHANGELOG.md | 1 + src/frontend/src/features/shortcuts/formatLabels.ts | 8 ++++++-- .../src/features/shortcuts/hooks/useShortcutFormatting.ts | 2 ++ src/frontend/src/locales/de/rooms.json | 2 ++ src/frontend/src/locales/en/rooms.json | 2 ++ src/frontend/src/locales/fr/rooms.json | 2 ++ src/frontend/src/locales/nl/rooms.json | 2 ++ 7 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c56491d..feaa28e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to - 💄(frontend) add focus ring to reaction emoji buttons - ✨(frontend) introduce a shortcut settings tab #975 - 🚚(frontend) rename "wellknown" directory to "well-known" #1009 +- 🌐(frontend) localize SR modifier labels #1010 ## [1.8.0] - 2026-02-20 diff --git a/src/frontend/src/features/shortcuts/formatLabels.ts b/src/frontend/src/features/shortcuts/formatLabels.ts index 598fb38b..18a0ceea 100644 --- a/src/frontend/src/features/shortcuts/formatLabels.ts +++ b/src/frontend/src/features/shortcuts/formatLabels.ts @@ -20,11 +20,15 @@ export const formatShortcutLabelForSR = ( { controlLabel, commandLabel, + altLabel, + shiftLabel, plusLabel, noShortcutLabel, }: { controlLabel: string commandLabel: string + altLabel: string + shiftLabel: string plusLabel: string noShortcutLabel: string } @@ -35,8 +39,8 @@ export const formatShortcutLabelForSR = ( const ctrlWord = isMacintosh() ? commandLabel : controlLabel const parts: string[] = [] if (shortcut.ctrlKey) parts.push(ctrlWord) - if (shortcut.altKey) parts.push('Alt') - if (shortcut.shiftKey) parts.push('Shift') + if (shortcut.altKey) parts.push(altLabel) + 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 44e75d9b..ba685ce3 100644 --- a/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts +++ b/src/frontend/src/features/shortcuts/hooks/useShortcutFormatting.ts @@ -37,6 +37,8 @@ export const useShortcutFormatting = () => { return formatShortcutLabelForSR(shortcut, { controlLabel: t('shortcutsPanel.sr.control'), commandLabel: t('shortcutsPanel.sr.command'), + altLabel: t('shortcutsPanel.sr.alt'), + 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 2f170f7c..095a9c80 100644 --- a/src/frontend/src/locales/de/rooms.json +++ b/src/frontend/src/locales/de/rooms.json @@ -619,6 +619,8 @@ "sr": { "control": "Steuerung", "command": "Befehl", + "alt": "Alt", + "shift": "Umschalt", "plus": "plus", "hold": "Halte {{key}} gedrückt", "noShortcut": "Kein Tastenkürzel" diff --git a/src/frontend/src/locales/en/rooms.json b/src/frontend/src/locales/en/rooms.json index 0baa228e..4c8e1991 100644 --- a/src/frontend/src/locales/en/rooms.json +++ b/src/frontend/src/locales/en/rooms.json @@ -619,6 +619,8 @@ "sr": { "control": "Control", "command": "Command", + "alt": "Alt", + "shift": "Shift", "plus": "plus", "hold": "Hold {{key}}", "noShortcut": "No shortcut" diff --git a/src/frontend/src/locales/fr/rooms.json b/src/frontend/src/locales/fr/rooms.json index b8d56006..78f48e9b 100644 --- a/src/frontend/src/locales/fr/rooms.json +++ b/src/frontend/src/locales/fr/rooms.json @@ -619,6 +619,8 @@ "sr": { "control": "Contrôle", "command": "Commande", + "alt": "Alt", + "shift": "Majuscule", "plus": "plus", "hold": "Maintenir {{key}}", "noShortcut": "Aucun raccourci" diff --git a/src/frontend/src/locales/nl/rooms.json b/src/frontend/src/locales/nl/rooms.json index 938af7bb..529e516f 100644 --- a/src/frontend/src/locales/nl/rooms.json +++ b/src/frontend/src/locales/nl/rooms.json @@ -619,6 +619,8 @@ "sr": { "control": "Control", "command": "Command", + "alt": "Alt", + "shift": "Shift", "plus": "plus", "hold": "Houd {{key}} ingedrukt", "noShortcut": "Geen sneltoets"