mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-08 19:35:11 +01:00
Add t
hotkey for post translations (#33441)
This commit is contained in:
parent
7cbdcd7b3f
commit
79a9069deb
@ -384,6 +384,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
toggleHidden: this.handleHotkeyToggleHidden,
|
toggleHidden: this.handleHotkeyToggleHidden,
|
||||||
toggleSensitive: this.handleHotkeyToggleSensitive,
|
toggleSensitive: this.handleHotkeyToggleSensitive,
|
||||||
openMedia: this.handleHotkeyOpenMedia,
|
openMedia: this.handleHotkeyOpenMedia,
|
||||||
|
onTranslate: this.handleTranslate,
|
||||||
};
|
};
|
||||||
|
|
||||||
let media, statusAvatar, prepend, rebloggedByText;
|
let media, statusAvatar, prepend, rebloggedByText;
|
||||||
|
@ -66,6 +66,10 @@ class KeyboardShortcuts extends ImmutablePureComponent {
|
|||||||
<td><kbd>enter</kbd>, <kbd>o</kbd></td>
|
<td><kbd>enter</kbd>, <kbd>o</kbd></td>
|
||||||
<td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
|
<td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><kbd>t</kbd></td>
|
||||||
|
<td><FormattedMessage id='keyboard_shortcuts.translate' defaultMessage='to translate a post' /></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><kbd>e</kbd></td>
|
<td><kbd>e</kbd></td>
|
||||||
<td><FormattedMessage id='keyboard_shortcuts.open_media' defaultMessage='to open media' /></td>
|
<td><FormattedMessage id='keyboard_shortcuts.open_media' defaultMessage='to open media' /></td>
|
||||||
|
@ -474,6 +474,10 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.handleToggleMediaVisibility();
|
this.handleToggleMediaVisibility();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleHotkeyTranslate = () => {
|
||||||
|
this.handleTranslate(this.props.status);
|
||||||
|
};
|
||||||
|
|
||||||
handleMoveUp = id => {
|
handleMoveUp = id => {
|
||||||
const { status, ancestorsIds, descendantsIds } = this.props;
|
const { status, ancestorsIds, descendantsIds } = this.props;
|
||||||
|
|
||||||
@ -650,6 +654,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
toggleHidden: this.handleHotkeyToggleHidden,
|
toggleHidden: this.handleHotkeyToggleHidden,
|
||||||
toggleSensitive: this.handleHotkeyToggleSensitive,
|
toggleSensitive: this.handleHotkeyToggleSensitive,
|
||||||
openMedia: this.handleHotkeyOpenMedia,
|
openMedia: this.handleHotkeyOpenMedia,
|
||||||
|
onTranslate: this.handleHotkeyTranslate,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -126,6 +126,7 @@ const keyMap = {
|
|||||||
toggleHidden: 'x',
|
toggleHidden: 'x',
|
||||||
toggleSensitive: 'h',
|
toggleSensitive: 'h',
|
||||||
openMedia: 'e',
|
openMedia: 'e',
|
||||||
|
onTranslate: 't',
|
||||||
};
|
};
|
||||||
|
|
||||||
class SwitchingColumnsArea extends PureComponent {
|
class SwitchingColumnsArea extends PureComponent {
|
||||||
|
@ -457,6 +457,7 @@
|
|||||||
"keyboard_shortcuts.toggle_hidden": "Show/hide text behind CW",
|
"keyboard_shortcuts.toggle_hidden": "Show/hide text behind CW",
|
||||||
"keyboard_shortcuts.toggle_sensitivity": "Show/hide media",
|
"keyboard_shortcuts.toggle_sensitivity": "Show/hide media",
|
||||||
"keyboard_shortcuts.toot": "Start a new post",
|
"keyboard_shortcuts.toot": "Start a new post",
|
||||||
|
"keyboard_shortcuts.translate": "to translate a post",
|
||||||
"keyboard_shortcuts.unfocus": "Unfocus compose textarea/search",
|
"keyboard_shortcuts.unfocus": "Unfocus compose textarea/search",
|
||||||
"keyboard_shortcuts.up": "Move up in the list",
|
"keyboard_shortcuts.up": "Move up in the list",
|
||||||
"lightbox.close": "Close",
|
"lightbox.close": "Close",
|
||||||
|
Loading…
Reference in New Issue
Block a user