Skip to content

Commit

Permalink
fix(KeyboardShortcuts): correctly localize shortcuts on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpatiiuk committed Jul 14, 2024
1 parent b2f2a97 commit d3623a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
exports[`Add renders without errors 1`] = `
<DocumentFragment>
<button
aria-label="Add (A)"
aria-label="Add (a)"
class="icon link rounded !text-green-700 print:hidden "
title="Add (A)"
title="Add (a)"
type="button"
>
<svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export function localizeKeyboardShortcut(shortcut: string): LocalizedString {

// If there is only one non-modifier key, then join the keys without separator
const resolved =
nonModifiers.length > 1
? [...modifiers, ...nonModifiers].join(localizedKeyJoinSymbol)
: `${modifiers.join('')}${nonModifiers[0]}`;
keyboardPlatform === 'mac' && nonModifiers.length === 1
? `${modifiers.join('')}${nonModifiers[0]}`
: [...modifiers, ...nonModifiers].join(localizedKeyJoinSymbol);

return localized(resolved);
}
Expand Down

0 comments on commit d3623a8

Please sign in to comment.