[Glitch] Add t hotkey for post translations

Port 79a9069deb to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire committed 2025-01-03 12:36:12 +01:00
1 parent 68106f250c
commit 04be5e7f12
4 files changed
+11

No files matched your search

@@ -473,6 +473,7 @@ class Status extends ImmutablePureComponent {
bookmark: this.handleHotkeyBookmark,
toggleSensitive: this.handleHotkeyToggleSensitive,
openMedia: this.handleHotkeyOpenMedia,
onTranslate: this.handleTranslate,
};
let prepend, rebloggedByText;
@@ -70,6 +70,10 @@ class KeyboardShortcuts extends ImmutablePureComponent {
<td><kbd>enter</kbd>, <kbd>o</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
</tr>
<tr>
<td><kbd>t</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.translate' defaultMessage='to translate a post' /></td>
</tr>
<tr>
<td><kbd>e</kbd></td>
<td><FormattedMessage id='keyboard_shortcuts.open_media' defaultMessage='to open media' /></td>
@@ -485,6 +485,10 @@ class Status extends ImmutablePureComponent {
this.props.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`);
};
handleHotkeyTranslate = () => {
this.handleTranslate(this.props.status);
};
handleMoveUp = id => {
const { status, ancestorsIds, descendantsIds } = this.props;
@@ -677,6 +681,7 @@ class Status extends ImmutablePureComponent {
toggleHidden: this.handleToggleHidden,
toggleSensitive: this.handleHotkeyToggleSensitive,
openMedia: this.handleHotkeyOpenMedia,
onTranslate: this.handleHotkeyTranslate,
};
return (
@@ -136,6 +136,7 @@ const keyMap = {
bookmark: 'd',
toggleSensitive: 'h',
openMedia: 'e',
onTranslate: 't',
};
class SwitchingColumnsArea extends PureComponent {