This commit is contained in:
Mirco Wittrien 2022-06-17 19:18:58 +02:00
parent edc7264ed7
commit 6d9cd932f8
3 changed files with 23 additions and 6 deletions

View File

@ -265,6 +265,7 @@
"MemberRoles": {"props": ["MemberRole"]},
"Message": {"strings": ["childrenMessageContent", "childrenRepliedMessage", "zalgo"]},
"MessageHeader": {"strings": ["ANIMATE_CHAT_AVATAR", "showUsernamePopout"]},
"MessageReply": {"strings": [".referencedMessage", ".useClickReferencedMessageAuthorUsername"]},
"Messages": {"strings": ["group-spacing-", "canManageMessages"]},
"MessageToolbar": {"strings": ["renderReactions", "canAddNewReactions", "showMoreUtilities"]},
"MessageUsername": {"strings": [".default.username", "colorString", "compact"]},

View File

@ -711,16 +711,15 @@ img:not([src]), img[src=""], img[src="null"] {
position: relative;
width: 100%;
}
[REPLACE_CLASS_table] [REPLACE_CLASS_tablespacerheader],
[REPLACE_CLASS_table] [REPLACE_CLASS_tablestickyheader] {
[REPLACE_CLASS_table] [REPLACE_CLASS_tablerow]:first-child {
padding: 0px 12px 8px 0;
margin-bottom: 5px;
box-sizing: border-box;
background-color: var(--background-primary);
border-bottom: 1px solid var(--background-modifier-accent);
}
[REPLACE_CLASS_table] [REPLACE_CLASS_tablestickyheader]:first-child {
position: absolute;
[REPLACE_CLASS_table] [REPLACE_CLASS_tablestickyheader] {
position: sticky;
width: 100%;
}
[REPLACE_CLASS_modalsub] [REPLACE_CLASS_table] [REPLACE_CLASS_tablestickyheader]:first-child {

View File

@ -2,7 +2,7 @@
* @name Translator
* @author DevilBro
* @authorId 278543574059057154
* @version 2.3.8
* @version 2.3.9
* @description Allows you to translate Messages and your outgoing Messages within Discord
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,8 +17,13 @@ module.exports = (_ => {
"info": {
"name": "Translator",
"author": "DevilBro",
"version": "2.3.8",
"version": "2.3.9",
"description": "Allows you to translate Messages and your outgoing Messages within Discord"
},
"changeLog": {
"fixed": {
"Replies": "Previews in Replies are now translated again"
}
}
};
@ -385,6 +390,7 @@ module.exports = (_ => {
after: {
ChannelTextAreaButtons: "type",
Messages: "type",
MessageReply: "default",
MessageContent: "type",
Embed: "render"
}
@ -687,6 +693,17 @@ module.exports = (_ => {
}
}
processMessageReply (e) {
if (e.returnvalue && e.returnvalue.props && e.returnvalue.props.children) {
let referencedMessage = BDFDB.ObjectUtils.get(e, "returnvalue.props.children.props.referencedMessage.message");
if (referencedMessage && translatedMessages[referencedMessage.id]) {
e.returnvalue.props.children.props.referencedMessage = Object.assign({}, e.returnvalue.props.children.props.referencedMessage);
e.returnvalue.props.children.props.referencedMessage.message = new BDFDB.DiscordObjects.Message(e.returnvalue.props.children.props.referencedMessage.message);
e.returnvalue.props.children.props.referencedMessage.message.content = translatedMessages[referencedMessage.id].content;
}
}
}
processMessageContent (e) {
if (e.instance.props.message) {
let translation = translatedMessages[e.instance.props.message.id];