This commit is contained in:
Mirco Wittrien 2019-10-24 13:11:20 +02:00
parent 3da383570c
commit c8a61c0ea0
15 changed files with 10 additions and 29 deletions

View File

@ -85,6 +85,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins || {}, cleanUps: BDFDB && BDFDB
});
};
BDFDB.PluginUtils.translate = function (plugin) {
plugin.labels = {};
if (typeof plugin.setLabelsByLanguage === "function" || typeof plugin.changeLanguageStrings === "function") {
if (document.querySelector("html").lang) translate();
else {
@ -99,8 +100,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins || {}, cleanUps: BDFDB && BDFDB
var language = BDFDB.LanguageUtils.getLanguage();
if (typeof plugin.setLabelsByLanguage === "function") plugin.labels = plugin.setLabelsByLanguage(language.id);
if (typeof plugin.changeLanguageStrings === "function") plugin.changeLanguageStrings();
var translatemessage = BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_translated", language.ownlang);
console.log(`%c[${plugin.name}]%c`, "color: #3a71c1; font-weight: 700;", "", translatemessage);
console.log(`%c[${plugin.name}]%c`, "color: #3a71c1; font-weight: 700;", "", BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_translated", language.ownlang));
}
}
};
@ -5392,6 +5392,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins || {}, cleanUps: BDFDB && BDFDB
NativeSubComponents.Switch = BDFDB.ModuleUtils.findByName("Switch");
NativeSubComponents.TabBar = BDFDB.ModuleUtils.findByName("TabBar");
NativeSubComponents.TextInput = BDFDB.ModuleUtils.findByName("TextInput");
NativeSubComponents.TooltipContainer = BDFDB.ModuleUtils.findByName("Tooltip");
LibraryComponents.BotTag = reactInitialized ? class BDFDB_BotTag extends LibraryModules.React.Component {
@ -5962,6 +5963,12 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins || {}, cleanUps: BDFDB && BDFDB
}
} : LibraryComponents.TextScroller;
LibraryComponents.TooltipContainer = reactInitialized ? class BDFDB_TooltipContainer extends LibraryModules.React.Component {
render() {
return BDFDB.ReactUtils.createElement(NativeSubComponents.TooltipContainer, Object.assign({}, this.props));
}
} : LibraryComponents.TooltipContainer;
for (let type in NativeSubComponents) if (LibraryComponents[type]) for (let key in NativeSubComponents[type]) if (key != "displayName" && key != "name") LibraryComponents[type][key] = NativeSubComponents[type][key];
BDFDB.LibraryComponents = Object.assign({}, LibraryComponents);

File diff suppressed because one or more lines are too long

View File

@ -14,8 +14,6 @@ class CreationDate {
"fixed":[["Milliseconds","Milliseconds are now properlly formatted when leading zeros is enabled (9 => 009, 12 => 012)"]]
};
this.labels = {};
this.patchModules = {
"UserPopout":"componentDidMount",
"UserProfile":"componentDidMount"

View File

@ -14,8 +14,6 @@ class EditChannels {
"fixed":[["Settings","Fixed issue where settings could not be saved"]]
};
this.labels = {};
this.patchModules = {
"ChannelTextArea":"componentDidMount",
"AuditLog":"componentDidMount",

View File

@ -14,8 +14,6 @@ class EditServers {
"fixed":[["Tooltips","Fixed issue where native tooltip wasn't hidden"]]
};
this.labels = {};
this.patchModules = {
"Guild":"componentDidMount",
"GuildIconWrapper":"componentDidMount",

View File

@ -14,8 +14,6 @@ class EditUsers {
"fixed":[["Account","Fixed the coloring in the account details container"]]
};
this.labels = {};
this.patchModules = {
"ChannelTextArea":"componentDidMount",
"MemberListItem":["componentDidMount","componentDidUpdate"],

View File

@ -14,8 +14,6 @@ class EmojiStatistics {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
};
this.labels = {};
this.patchModules = {
"EmojiPicker":"componentDidMount"
};

View File

@ -13,8 +13,6 @@ class GoogleSearchReplace {
this.changelog = {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
};
this.labels = {};
}
initConstructor () {

View File

@ -14,8 +14,6 @@ class GoogleTranslateOption {
"improved":[["Embeds","Translating a message now also translates the embed descriptions (usually the maintext of embeds)"]]
};
this.labels = {};
this.patchModules = {
"ChannelTextArea":["componentDidMount","render"],
"Message":"componentDidMount",

View File

@ -14,8 +14,6 @@ class JoinedAtDate {
"fixed":[["Milliseconds","Milliseconds are now properlly formatted when leading zeros is enabled (9 => 009, 12 => 012)"]]
};
this.labels = {};
this.patchModules = {
"UserPopout":"componentDidMount",
"UserProfile":"componentDidMount"

View File

@ -14,8 +14,6 @@ class LastMessageDate {
"fixed":[["Milliseconds","Milliseconds are now properlly formatted when leading zeros is enabled (9 => 009, 12 => 012)"]]
};
this.labels = {};
this.patchModules = {
"UserPopout":"componentDidMount",
"UserProfile":"componentDidMount"

View File

@ -14,8 +14,6 @@ class PersonalPins {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
};
this.labels = {};
this.patchModules = {
"HeaderBar":["componentDidMount","componentDidUpdate"],
"HeaderBarContainer":["componentDidMount","componentDidUpdate"],

View File

@ -14,8 +14,6 @@ class SendLargeMessages {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
};
this.labels = {};
this.patchModules = {
"ChannelTextArea":"componentDidMount"
};

View File

@ -14,8 +14,6 @@ class ServerFolders {
"fixed":[["Tooltips","Fixed issue where native tooltip wasn't hidden"]]
};
this.labels = {};
this.patchModules = {
"Guilds":["componentDidMount","componentDidUpdate","componentWillUnmount"],
"GuildFolder":["componentDidMount","componentDidUpdate"],

View File

@ -14,8 +14,6 @@ class ServerHider {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]]
};
this.labels = {};
this.patchModules = {
"Guild":["componentDidMount","componentDidUpdate"]
};