Translator: Added param to translateText() to not show progress toasts

This commit is contained in:
Lance Fetters 2023-09-28 15:26:41 +01:00
parent 8524db576d
commit 4dbb44cb2c
1 changed files with 3 additions and 2 deletions

View File

@ -895,7 +895,7 @@ module.exports = (_ => {
});
}
translateText (text, place, callback) {
translateText (text, place, showToast = true, callback) {
let toast = null, toastInterval, finished = false, finishTranslation = translation => {
isTranslating = false;
if (toast) toast.close();
@ -933,6 +933,7 @@ module.exports = (_ => {
if (toast) toast.close();
BDFDB.TimeUtils.clear(toastInterval);
if (!showToast) return;
toast = BDFDB.NotificationUtils.toast(`${this.labels.toast_translating} (${translationEngines[engine].name}) - ${BDFDB.LanguageUtils.LibraryStrings.please_wait}`, {
timeout: 0,
ellipsis: true,
@ -2468,4 +2469,4 @@ module.exports = (_ => {
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
})();
})();