diff --git a/src/api/ChatButtons.tsx b/src/api/ChatButtons.tsx index c995033b1..3cef250b3 100644 --- a/src/api/ChatButtons.tsx +++ b/src/api/ChatButtons.tsx @@ -80,8 +80,6 @@ const buttonFactories = new Map(); const logger = new Logger("ChatButtons"); export function _injectButtons(buttons: ReactNode[], props: ChatBarProps) { - if (props.type.analyticsName !== "normal") return; - for (const [key, makeButton] of buttonFactories) { try { const res = makeButton(props, props.type.analyticsName === "normal"); diff --git a/src/plugins/translate/TranslateIcon.tsx b/src/plugins/translate/TranslateIcon.tsx index a7d789279..7371f78bf 100644 --- a/src/plugins/translate/TranslateIcon.tsx +++ b/src/plugins/translate/TranslateIcon.tsx @@ -17,8 +17,10 @@ */ import { ChatBarButton } from "@api/ChatButtons"; +import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { openModal } from "@utils/modal"; +import { Alerts, Forms } from "@webpack/common"; import { settings } from "./settings"; import { TranslateModal } from "./TranslateModal"; @@ -42,7 +44,27 @@ export const TranslateChatBarIcon: ChatBarButton = (props, isMainChat) => { if (!isMainChat) return null; - const toggle = () => settings.store.autoTranslate = !autoTranslate; + const toggle = () => { + const newState = !autoTranslate; + settings.store.autoTranslate = newState; + if (newState && settings.store.showAutoTranslateAlert !== false) + Alerts.show({ + title: "Vencord Auto-Translate Enabled", + body: <> + + You just enabled auto translate (by right clicking the Translate icon). Any message you send will automatically be translated before being sent. + + + If this was an accident, disable it again, or it will change your message content before sending. + + , + cancelText: "Disable Auto-Translate", + confirmText: "Got it", + secondaryConfirmText: "Don't show again", + onConfirmSecondary: () => settings.store.showAutoTranslateAlert = false, + onCancel: () => settings.store.autoTranslate = false + }); + }; return ( ();