Translator: Added param to translateText() to not show progress toasts
This commit is contained in:
parent
8524db576d
commit
4dbb44cb2c
|
@ -895,7 +895,7 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
translateText (text, place, callback) {
|
translateText (text, place, showToast = true, callback) {
|
||||||
let toast = null, toastInterval, finished = false, finishTranslation = translation => {
|
let toast = null, toastInterval, finished = false, finishTranslation = translation => {
|
||||||
isTranslating = false;
|
isTranslating = false;
|
||||||
if (toast) toast.close();
|
if (toast) toast.close();
|
||||||
|
@ -933,6 +933,7 @@ module.exports = (_ => {
|
||||||
if (toast) toast.close();
|
if (toast) toast.close();
|
||||||
BDFDB.TimeUtils.clear(toastInterval);
|
BDFDB.TimeUtils.clear(toastInterval);
|
||||||
|
|
||||||
|
if (!showToast) return;
|
||||||
toast = BDFDB.NotificationUtils.toast(`${this.labels.toast_translating} (${translationEngines[engine].name}) - ${BDFDB.LanguageUtils.LibraryStrings.please_wait}`, {
|
toast = BDFDB.NotificationUtils.toast(`${this.labels.toast_translating} (${translationEngines[engine].name}) - ${BDFDB.LanguageUtils.LibraryStrings.please_wait}`, {
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
@ -2468,4 +2469,4 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
|
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue