|
|
@ -17,8 +17,10 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import { ChatBarButton } from "@api/ChatButtons";
|
|
|
|
import { ChatBarButton } from "@api/ChatButtons";
|
|
|
|
|
|
|
|
import { Margins } from "@utils/margins";
|
|
|
|
import { classes } from "@utils/misc";
|
|
|
|
import { classes } from "@utils/misc";
|
|
|
|
import { openModal } from "@utils/modal";
|
|
|
|
import { openModal } from "@utils/modal";
|
|
|
|
|
|
|
|
import { Alerts, Forms } from "@webpack/common";
|
|
|
|
|
|
|
|
|
|
|
|
import { settings } from "./settings";
|
|
|
|
import { settings } from "./settings";
|
|
|
|
import { TranslateModal } from "./TranslateModal";
|
|
|
|
import { TranslateModal } from "./TranslateModal";
|
|
|
@ -42,7 +44,27 @@ export const TranslateChatBarIcon: ChatBarButton = (props, isMainChat) => {
|
|
|
|
|
|
|
|
|
|
|
|
if (!isMainChat) return null;
|
|
|
|
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: <>
|
|
|
|
|
|
|
|
<Forms.FormText>
|
|
|
|
|
|
|
|
You just enabled auto translate (by right clicking the Translate icon). Any message you send will automatically be translated before being sent.
|
|
|
|
|
|
|
|
</Forms.FormText>
|
|
|
|
|
|
|
|
<Forms.FormText className={Margins.top16}>
|
|
|
|
|
|
|
|
If this was an accident, disable it again, or it will change your message content before sending.
|
|
|
|
|
|
|
|
</Forms.FormText>
|
|
|
|
|
|
|
|
</>,
|
|
|
|
|
|
|
|
cancelText: "Disable Auto-Translate",
|
|
|
|
|
|
|
|
confirmText: "Got it",
|
|
|
|
|
|
|
|
secondaryConfirmText: "Don't show again",
|
|
|
|
|
|
|
|
onConfirmSecondary: () => settings.store.showAutoTranslateAlert = false,
|
|
|
|
|
|
|
|
onCancel: () => settings.store.autoTranslate = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ChatBarButton
|
|
|
|
<ChatBarButton
|
|
|
|