🌐(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,
|
controlLabel,
|
||||||
commandLabel,
|
commandLabel,
|
||||||
altLabel,
|
altLabel,
|
||||||
|
optionLabel,
|
||||||
shiftLabel,
|
shiftLabel,
|
||||||
plusLabel,
|
plusLabel,
|
||||||
noShortcutLabel,
|
noShortcutLabel,
|
||||||
@@ -28,6 +29,7 @@ export const formatShortcutLabelForSR = (
|
|||||||
controlLabel: string
|
controlLabel: string
|
||||||
commandLabel: string
|
commandLabel: string
|
||||||
altLabel: string
|
altLabel: string
|
||||||
|
optionLabel: string
|
||||||
shiftLabel: string
|
shiftLabel: string
|
||||||
plusLabel: string
|
plusLabel: string
|
||||||
noShortcutLabel: string
|
noShortcutLabel: string
|
||||||
@@ -37,9 +39,10 @@ export const formatShortcutLabelForSR = (
|
|||||||
const key = shortcut.key?.toUpperCase()
|
const key = shortcut.key?.toUpperCase()
|
||||||
if (!key) return noShortcutLabel
|
if (!key) return noShortcutLabel
|
||||||
const ctrlWord = isMacintosh() ? commandLabel : controlLabel
|
const ctrlWord = isMacintosh() ? commandLabel : controlLabel
|
||||||
|
const altWord = isMacintosh() ? optionLabel : altLabel
|
||||||
const parts: string[] = []
|
const parts: string[] = []
|
||||||
if (shortcut.ctrlKey) parts.push(ctrlWord)
|
if (shortcut.ctrlKey) parts.push(ctrlWord)
|
||||||
if (shortcut.altKey) parts.push(altLabel)
|
if (shortcut.altKey) parts.push(altWord)
|
||||||
if (shortcut.shiftKey) parts.push(shiftLabel)
|
if (shortcut.shiftKey) parts.push(shiftLabel)
|
||||||
parts.push(key)
|
parts.push(key)
|
||||||
return parts.join(` ${plusLabel} `)
|
return parts.join(` ${plusLabel} `)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export const useShortcutFormatting = () => {
|
|||||||
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'),
|
altLabel: t('shortcutsPanel.sr.alt'),
|
||||||
|
optionLabel: t('shortcutsPanel.sr.option'),
|
||||||
shiftLabel: t('shortcutsPanel.sr.shift'),
|
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'),
|
||||||
|
|||||||
@@ -620,6 +620,7 @@
|
|||||||
"control": "Steuerung",
|
"control": "Steuerung",
|
||||||
"command": "Befehl",
|
"command": "Befehl",
|
||||||
"alt": "Alt",
|
"alt": "Alt",
|
||||||
|
"option": "Option",
|
||||||
"shift": "Umschalt",
|
"shift": "Umschalt",
|
||||||
"plus": "plus",
|
"plus": "plus",
|
||||||
"hold": "Halte {{key}} gedrückt",
|
"hold": "Halte {{key}} gedrückt",
|
||||||
|
|||||||
@@ -620,6 +620,7 @@
|
|||||||
"control": "Control",
|
"control": "Control",
|
||||||
"command": "Command",
|
"command": "Command",
|
||||||
"alt": "Alt",
|
"alt": "Alt",
|
||||||
|
"option": "Option",
|
||||||
"shift": "Shift",
|
"shift": "Shift",
|
||||||
"plus": "plus",
|
"plus": "plus",
|
||||||
"hold": "Hold {{key}}",
|
"hold": "Hold {{key}}",
|
||||||
|
|||||||
@@ -620,6 +620,7 @@
|
|||||||
"control": "Contrôle",
|
"control": "Contrôle",
|
||||||
"command": "Commande",
|
"command": "Commande",
|
||||||
"alt": "Alt",
|
"alt": "Alt",
|
||||||
|
"option": "Option",
|
||||||
"shift": "Majuscule",
|
"shift": "Majuscule",
|
||||||
"plus": "plus",
|
"plus": "plus",
|
||||||
"hold": "Maintenir {{key}}",
|
"hold": "Maintenir {{key}}",
|
||||||
|
|||||||
@@ -620,6 +620,7 @@
|
|||||||
"control": "Control",
|
"control": "Control",
|
||||||
"command": "Command",
|
"command": "Command",
|
||||||
"alt": "Alt",
|
"alt": "Alt",
|
||||||
|
"option": "Option",
|
||||||
"shift": "Shift",
|
"shift": "Shift",
|
||||||
"plus": "plus",
|
"plus": "plus",
|
||||||
"hold": "Houd {{key}} ingedrukt",
|
"hold": "Houd {{key}} ingedrukt",
|
||||||
|
|||||||
Reference in New Issue
Block a user