mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 09:03:03 -04:00
Drop DoNotLeak + Extras
Co-Authored-By: thororen1234 <thororen1234@users.noreply.github.com> Co-Authored-By: thororen <78185467+thororen1234@users.noreply.github.com> Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com> Co-Authored-By: ynot01 <ynot000001@gmail.com> Co-Authored-By: MrDiamondDog <84212701+MrDiamondDog@users.noreply.github.com> Co-Authored-By: Crxaw <48805031+sitescript@users.noreply.github.com>
This commit is contained in:
parent
7731a7f0e5
commit
83c3497951
17 changed files with 68 additions and 223 deletions
|
@ -57,7 +57,7 @@ export function TranslationAccessory({ message }: { message: Message; }) {
|
|||
<span className={cl("accessory")}>
|
||||
<TranslateIcon width={16} height={16} className={cl("accessory-icon")} />
|
||||
{Parser.parse(translation.text)}
|
||||
{" "}
|
||||
<br />
|
||||
(translated from {translation.sourceLanguage} - <Dismiss onDismiss={() => setTranslation(undefined)} />)
|
||||
</span>
|
||||
);
|
||||
|
|
|
@ -22,12 +22,21 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co
|
|||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { ChannelStore, Menu } from "@webpack/common";
|
||||
import { Message } from "discord-types/general";
|
||||
|
||||
import { settings } from "./settings";
|
||||
import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon";
|
||||
import { handleTranslate, TranslationAccessory } from "./TranslationAccessory";
|
||||
import { translate } from "./utils";
|
||||
|
||||
interface IMessageCreate {
|
||||
type: "MESSAGE_CREATE";
|
||||
optimistic: boolean;
|
||||
isPushNotification: boolean;
|
||||
channelId: string;
|
||||
message: Message;
|
||||
}
|
||||
|
||||
const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => {
|
||||
if (!message.content) return;
|
||||
|
||||
|
|
|
@ -78,6 +78,11 @@ export const settings = definePluginSettings({
|
|||
description: "Show a tooltip on the ChatBar button whenever a message is automatically translated",
|
||||
default: true
|
||||
},
|
||||
disableOnSameLanguage: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Disable auto translate if the current language doesnt change",
|
||||
default: true
|
||||
}
|
||||
}).withPrivateSettings<{
|
||||
showAutoTranslateAlert: boolean;
|
||||
}>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue