🌐(frontend) localize SR modifier labels

Replace hardcoded 'Alt' and 'Shift' in the SR shortcut
This commit is contained in:
Cyril
2026-02-24 09:02:40 +01:00
parent 1c1d1938d9
commit 7bf623f654
7 changed files with 17 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ and this project adheres to
- 💄(frontend) add focus ring to reaction emoji buttons - 💄(frontend) add focus ring to reaction emoji buttons
- ✨(frontend) introduce a shortcut settings tab #975 - ✨(frontend) introduce a shortcut settings tab #975
- 🚚(frontend) rename "wellknown" directory to "well-known" #1009 - 🚚(frontend) rename "wellknown" directory to "well-known" #1009
- 🌐(frontend) localize SR modifier labels #1010
## [1.8.0] - 2026-02-20 ## [1.8.0] - 2026-02-20

View File

@@ -20,11 +20,15 @@ export const formatShortcutLabelForSR = (
{ {
controlLabel, controlLabel,
commandLabel, commandLabel,
altLabel,
shiftLabel,
plusLabel, plusLabel,
noShortcutLabel, noShortcutLabel,
}: { }: {
controlLabel: string controlLabel: string
commandLabel: string commandLabel: string
altLabel: string
shiftLabel: string
plusLabel: string plusLabel: string
noShortcutLabel: string noShortcutLabel: string
} }
@@ -35,8 +39,8 @@ export const formatShortcutLabelForSR = (
const ctrlWord = isMacintosh() ? commandLabel : controlLabel const ctrlWord = isMacintosh() ? commandLabel : controlLabel
const parts: string[] = [] const parts: string[] = []
if (shortcut.ctrlKey) parts.push(ctrlWord) if (shortcut.ctrlKey) parts.push(ctrlWord)
if (shortcut.altKey) parts.push('Alt') if (shortcut.altKey) parts.push(altLabel)
if (shortcut.shiftKey) parts.push('Shift') if (shortcut.shiftKey) parts.push(shiftLabel)
parts.push(key) parts.push(key)
return parts.join(` ${plusLabel} `) return parts.join(` ${plusLabel} `)
} }

View File

@@ -37,6 +37,8 @@ export const useShortcutFormatting = () => {
return formatShortcutLabelForSR(shortcut, { return formatShortcutLabelForSR(shortcut, {
controlLabel: t('shortcutsPanel.sr.control'), controlLabel: t('shortcutsPanel.sr.control'),
commandLabel: t('shortcutsPanel.sr.command'), commandLabel: t('shortcutsPanel.sr.command'),
altLabel: t('shortcutsPanel.sr.alt'),
shiftLabel: t('shortcutsPanel.sr.shift'),
plusLabel: t('shortcutsPanel.sr.plus'), plusLabel: t('shortcutsPanel.sr.plus'),
noShortcutLabel: t('shortcutsPanel.sr.noShortcut'), noShortcutLabel: t('shortcutsPanel.sr.noShortcut'),
}) })

View File

@@ -619,6 +619,8 @@
"sr": { "sr": {
"control": "Steuerung", "control": "Steuerung",
"command": "Befehl", "command": "Befehl",
"alt": "Alt",
"shift": "Umschalt",
"plus": "plus", "plus": "plus",
"hold": "Halte {{key}} gedrückt", "hold": "Halte {{key}} gedrückt",
"noShortcut": "Kein Tastenkürzel" "noShortcut": "Kein Tastenkürzel"

View File

@@ -619,6 +619,8 @@
"sr": { "sr": {
"control": "Control", "control": "Control",
"command": "Command", "command": "Command",
"alt": "Alt",
"shift": "Shift",
"plus": "plus", "plus": "plus",
"hold": "Hold {{key}}", "hold": "Hold {{key}}",
"noShortcut": "No shortcut" "noShortcut": "No shortcut"

View File

@@ -619,6 +619,8 @@
"sr": { "sr": {
"control": "Contrôle", "control": "Contrôle",
"command": "Commande", "command": "Commande",
"alt": "Alt",
"shift": "Majuscule",
"plus": "plus", "plus": "plus",
"hold": "Maintenir {{key}}", "hold": "Maintenir {{key}}",
"noShortcut": "Aucun raccourci" "noShortcut": "Aucun raccourci"

View File

@@ -619,6 +619,8 @@
"sr": { "sr": {
"control": "Control", "control": "Control",
"command": "Command", "command": "Command",
"alt": "Alt",
"shift": "Shift",
"plus": "plus", "plus": "plus",
"hold": "Houd {{key}} ingedrukt", "hold": "Houd {{key}} ingedrukt",
"noShortcut": "Geen sneltoets" "noShortcut": "Geen sneltoets"