🌐(frontend) localize SR modifier labels
Replace hardcoded 'Alt'/'Shift' in SR formatter with i18next labels. Use Option/Alt distinction on Mac like Ctrl/Command.
This commit is contained in:
@@ -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} `)
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -620,6 +620,7 @@
|
||||
"control": "Steuerung",
|
||||
"command": "Befehl",
|
||||
"alt": "Alt",
|
||||
"option": "Option",
|
||||
"shift": "Umschalt",
|
||||
"plus": "plus",
|
||||
"hold": "Halte {{key}} gedrückt",
|
||||
|
||||
@@ -620,6 +620,7 @@
|
||||
"control": "Control",
|
||||
"command": "Command",
|
||||
"alt": "Alt",
|
||||
"option": "Option",
|
||||
"shift": "Shift",
|
||||
"plus": "plus",
|
||||
"hold": "Hold {{key}}",
|
||||
|
||||
@@ -620,6 +620,7 @@
|
||||
"control": "Contrôle",
|
||||
"command": "Commande",
|
||||
"alt": "Alt",
|
||||
"option": "Option",
|
||||
"shift": "Majuscule",
|
||||
"plus": "plus",
|
||||
"hold": "Maintenir {{key}}",
|
||||
|
||||
@@ -620,6 +620,7 @@
|
||||
"control": "Control",
|
||||
"command": "Command",
|
||||
"alt": "Alt",
|
||||
"option": "Option",
|
||||
"shift": "Shift",
|
||||
"plus": "plus",
|
||||
"hold": "Houd {{key}} ingedrukt",
|
||||
|
||||
Reference in New Issue
Block a user