Translate keyboard shortcut alternate key names (#7633)
This commit is contained in:
parent
88cd2f8af7
commit
b7099f84c3
3 changed files with 13 additions and 5 deletions
|
@ -50,6 +50,8 @@ import DocumentPosition from "../../../editor/position";
|
|||
import { ICompletion } from "../../../autocomplete/Autocompleter";
|
||||
import { AutocompleteAction, getKeyBindingsManager, MessageComposerAction } from '../../../KeyBindingsManager';
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { ALTERNATE_KEY_NAME } from '../../../accessibility/KeyboardShortcuts';
|
||||
import { _t } from "../../../languageHandler";
|
||||
|
||||
// matches emoticons which follow the start of a line or whitespace
|
||||
const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')\\s|:^$');
|
||||
|
@ -66,7 +68,7 @@ const SURROUND_WITH_DOUBLE_CHARACTERS = new Map([
|
|||
]);
|
||||
|
||||
function ctrlShortcutLabel(key: string): string {
|
||||
return (IS_MAC ? "⌘" : "Ctrl") + "+" + key;
|
||||
return (IS_MAC ? "⌘" : _t(ALTERNATE_KEY_NAME[Key.CONTROL])) + "+" + key;
|
||||
}
|
||||
|
||||
function cloneSelection(selection: Selection): Partial<Selection> {
|
||||
|
|
|
@ -62,12 +62,13 @@ import QuickSettingsButton from "./QuickSettingsButton";
|
|||
import { useSettingValue } from "../../../hooks/useSettings";
|
||||
import UserMenu from "../../structures/UserMenu";
|
||||
import IndicatorScrollbar from "../../structures/IndicatorScrollbar";
|
||||
import { isMac } from "../../../Keyboard";
|
||||
import { isMac, Key } from "../../../Keyboard";
|
||||
import { useDispatcher } from "../../../hooks/useDispatcher";
|
||||
import defaultDispatcher from "../../../dispatcher/dispatcher";
|
||||
import { ActionPayload } from "../../../dispatcher/payloads";
|
||||
import { Action } from "../../../dispatcher/actions";
|
||||
import { NotificationState } from "../../../stores/notifications/NotificationState";
|
||||
import { ALTERNATE_KEY_NAME } from "../../../accessibility/KeyboardShortcuts";
|
||||
|
||||
const useSpaces = (): [Room[], MetaSpace[], Room[], SpaceKey] => {
|
||||
const invites = useEventEmitterState<Room[]>(SpaceStore.instance, UPDATE_INVITED_SPACES, () => {
|
||||
|
@ -340,7 +341,11 @@ const SpacePanel = () => {
|
|||
{ isPanelCollapsed ? _t("Expand") : _t("Collapse") }
|
||||
</div>
|
||||
<div className="mx_Tooltip_sub">
|
||||
{ isMac ? "⌘ + ⇧ + D" : "Ctrl + Shift + D" }
|
||||
{ isMac
|
||||
? "⌘ + ⇧ + D"
|
||||
: _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " + " +
|
||||
_t(ALTERNATE_KEY_NAME[Key.SHIFT]) + " + D"
|
||||
}
|
||||
</div>
|
||||
</div>}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue