diff --git a/src/plugins/translate/TranslateIcon.tsx b/src/plugins/translate/TranslateIcon.tsx index af97a53b0..bdec12769 100644 --- a/src/plugins/translate/TranslateIcon.tsx +++ b/src/plugins/translate/TranslateIcon.tsx @@ -43,6 +43,8 @@ export function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { ana if (slateProps.type.analyticsName !== "normal") return null; + const toggle = () => settings.store.autoTranslate = !autoTranslate; + return ( {({ onMouseEnter, onMouseLeave }) => ( @@ -55,11 +57,14 @@ export function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { ana onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} innerClassName={ButtonWrapperClasses.button} - onClick={() => + onClick={e => { + if (e.shiftKey) return toggle(); + openModal(props => ( - )) - } + )); + }} + onContextMenu={() => toggle()} style={{ padding: "0 4px" }} >
diff --git a/src/plugins/translate/settings.ts b/src/plugins/translate/settings.ts index 13e6540a7..aa4f633a7 100644 --- a/src/plugins/translate/settings.ts +++ b/src/plugins/translate/settings.ts @@ -46,7 +46,7 @@ export const settings = definePluginSettings({ }, autoTranslate: { type: OptionType.BOOLEAN, - description: "Automatically translate your messages before sending", + description: "Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this", default: false } });