diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index a2759b8345..2be3b94285 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -384,6 +384,7 @@ class Status extends ImmutablePureComponent { toggleHidden: this.handleHotkeyToggleHidden, toggleSensitive: this.handleHotkeyToggleSensitive, openMedia: this.handleHotkeyOpenMedia, + onTranslate: this.handleTranslate, }; let media, statusAvatar, prepend, rebloggedByText; diff --git a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx index e342958480..285f0ea7cf 100644 --- a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx @@ -66,6 +66,10 @@ class KeyboardShortcuts extends ImmutablePureComponent { enter, o + + t + + e diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 8da3d7e11a..4b9e035a5f 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -474,6 +474,10 @@ class Status extends ImmutablePureComponent { this.handleToggleMediaVisibility(); }; + handleHotkeyTranslate = () => { + this.handleTranslate(this.props.status); + }; + handleMoveUp = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -650,6 +654,7 @@ class Status extends ImmutablePureComponent { toggleHidden: this.handleHotkeyToggleHidden, toggleSensitive: this.handleHotkeyToggleSensitive, openMedia: this.handleHotkeyOpenMedia, + onTranslate: this.handleHotkeyTranslate, }; return ( diff --git a/app/javascript/mastodon/features/ui/index.jsx b/app/javascript/mastodon/features/ui/index.jsx index 052ac0ac5b..bfc540a331 100644 --- a/app/javascript/mastodon/features/ui/index.jsx +++ b/app/javascript/mastodon/features/ui/index.jsx @@ -126,6 +126,7 @@ const keyMap = { toggleHidden: 'x', toggleSensitive: 'h', openMedia: 'e', + onTranslate: 't', }; class SwitchingColumnsArea extends PureComponent { diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 2a4258a7d4..cf5834835d 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -457,6 +457,7 @@ "keyboard_shortcuts.toggle_hidden": "Show/hide text behind CW", "keyboard_shortcuts.toggle_sensitivity": "Show/hide media", "keyboard_shortcuts.toot": "Start a new post", + "keyboard_shortcuts.translate": "to translate a post", "keyboard_shortcuts.unfocus": "Unfocus compose textarea/search", "keyboard_shortcuts.up": "Move up in the list", "lightbox.close": "Close",