stuff
This commit is contained in:
parent
76134c71ee
commit
be71583782
|
@ -661,7 +661,7 @@ module.exports = (_ => {
|
|||
let currentLoadingString = loadingString;
|
||||
toast = BDFDB.NotificationUtils.toast(loadingString, {
|
||||
timeout: 0,
|
||||
orientation: "center",
|
||||
position: "center",
|
||||
onClose: _ => {BDFDB.TimeUtils.clear(toastInterval);}
|
||||
});
|
||||
toastInterval = BDFDB.TimeUtils.interval(_ => {
|
||||
|
@ -669,7 +669,7 @@ module.exports = (_ => {
|
|||
finishTranslation("");
|
||||
BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed} - ${this.labels.toast_translating_tryanother}`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
@ -743,11 +743,11 @@ module.exports = (_ => {
|
|||
else {
|
||||
if (response.statusCode == 429) BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Request Limit per Hour is reached.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
else BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Translation Server might be down.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
callback("");
|
||||
}
|
||||
|
@ -786,7 +786,7 @@ module.exports = (_ => {
|
|||
else {
|
||||
BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Translation Server is down or API-key outdated.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
callback("");
|
||||
}
|
||||
|
@ -825,14 +825,14 @@ module.exports = (_ => {
|
|||
if (result && result.indexOf('code="408"') > -1) {
|
||||
BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Monthly rate limit reached.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
callback("");
|
||||
}
|
||||
else {
|
||||
BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Translation Server is down or API-key outdated.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
callback("");
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ module.exports = (_ => {
|
|||
else {
|
||||
BDFDB.NotificationUtils.toast(`${this.labels.toast_translating_failed}. ${this.labels.toast_translating_tryanother}. Translation Server is down, daily limited reached or API-key outdated.`, {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
callback("");
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ module.exports = (_ => {
|
|||
}
|
||||
else BDFDB.NotificationUtils.toast("Invalid binary format. Only use 0s and 1s.", {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
return string;
|
||||
}
|
||||
|
|
|
@ -340,7 +340,7 @@ module.exports = (_ => {
|
|||
let currentLoadingString = loadingString;
|
||||
languageToasts[key] = BDFDB.NotificationUtils.toast(loadingString, {
|
||||
timeout: 0,
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
languageToasts[key].interval = BDFDB.TimeUtils.interval(_ => {
|
||||
currentLoadingString = currentLoadingString.endsWith(".....") ? loadingString : currentLoadingString + ".";
|
||||
|
@ -356,7 +356,7 @@ module.exports = (_ => {
|
|||
if (error || (response && body.toLowerCase().indexOf("<!doctype html>") > -1)) {
|
||||
BDFDB.NotificationUtils.toast(this.labels.toast_dictionary_fail.replace("{{var0}}", this.getLanguageName(languages[lang])), {
|
||||
type: "danger",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
}
|
||||
else if (response && languageToasts[key].lang == lang) {
|
||||
|
@ -368,7 +368,7 @@ module.exports = (_ => {
|
|||
dictionaries[key] = this.formatDictionary(langDictionaries[key].concat(ownDictionary));
|
||||
BDFDB.NotificationUtils.toast(this.labels.toast_dictionary_success.replace("{{var0}}", this.getLanguageName(languages[lang])), {
|
||||
type: "success",
|
||||
orientation: "center"
|
||||
position: "center"
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue