fix: localize plugin operation errors
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
"ui.openExternal": "Открыть во внешнем приложении",
|
||||
"ui.preview": "Просмотр",
|
||||
"ui.loading": "Загрузка...",
|
||||
"ui.error": "Ошибка просмотра: {error}"
|
||||
"ui.error": "Не удалось открыть предварительный просмотр файла. Повторите попытку."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user