fix: localize plugin operation errors

This commit is contained in:
2026-07-14 22:00:24 +08:00
parent 1f03226378
commit a1b3c31d0d
37 changed files with 330 additions and 154 deletions
+2 -1
View File
@@ -143,8 +143,9 @@
return null;
});
}).catch(function (err) {
console.warn('[file-preview] preview error:', err);
body.className = 'fp-error';
body.textContent = tr('ui.error', { error: err && err.message ? err.message : String(err) }, 'Preview error: ' + (err && err.message ? err.message : String(err)));
body.textContent = tr('ui.error', null, 'Could not preview this file. Please try again.');
});
if (api.i18n && typeof api.i18n.onDidChangeLocale === 'function') {
api.i18n.onDidChangeLocale(function () {
+1 -1
View File
@@ -5,5 +5,5 @@
"ui.openExternal": "Open External",
"ui.preview": "Preview",
"ui.loading": "Loading...",
"ui.error": "Preview error: {error}"
"ui.error": "Could not preview this file. Please try again."
}
+1 -1
View File
@@ -5,5 +5,5 @@
"ui.openExternal": "Открыть во внешнем приложении",
"ui.preview": "Просмотр",
"ui.loading": "Загрузка...",
"ui.error": "Ошибка просмотра: {error}"
"ui.error": "Не удалось открыть предварительный просмотр файла. Повторите попытку."
}