diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 4ee04f552..d4573554a 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -977,6 +977,10 @@ async function getExpressionLabel(text) { return getFallbackExpression(); } + if (extension_settings.expressions.translate && typeof window['translate'] === 'function') { + text = await window['translate'](text, 'en'); + } + text = sampleClassifyText(text); try { @@ -1717,6 +1721,10 @@ async function fetchImagesNoCache() { $('#expressions_show_default').on('input', onExpressionsShowDefaultInput); $('#expression_upload_pack_button').on('click', onClickExpressionUploadPackButton); $('#expressions_show_default').prop('checked', extension_settings.expressions.showDefault).trigger('input'); + $('#expression_translate').prop('checked', extension_settings.expressions.translate).on('input', function () { + extension_settings.expressions.translate = !!$(this).prop('checked'); + saveSettingsDebounced(); + }); $('#expression_local').prop('checked', extension_settings.expressions.local).on('input', function () { extension_settings.expressions.local = !!$(this).prop('checked'); moduleWorker(); diff --git a/public/scripts/extensions/expressions/settings.html b/public/scripts/extensions/expressions/settings.html index 4abc49fcc..b0b3b0bd3 100644 --- a/public/scripts/extensions/expressions/settings.html +++ b/public/scripts/extensions/expressions/settings.html @@ -10,6 +10,10 @@ Local server classification +