🌐(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) 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

View File

@@ -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} `)
}

View File

@@ -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'),
})

View File

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

View File

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

View File

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

View File

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