fix: 添加OCR未知错误的翻译并更新错误提示

在OCR处理失败时,使用翻译后的错误消息替代原始错误提示
This commit is contained in:
icarus 2025-08-22 18:44:51 +08:00
parent 97435c9294
commit a4257d9efe
2 changed files with 4 additions and 1 deletions

View File

@ -1559,6 +1559,9 @@
"tip": "如果响应成功则只针对超过30秒的消息进行提醒"
},
"ocr": {
"error": {
"unknown": "OCR过程发生错误"
},
"file": {
"not_supported": "不支持的文件类型 {{type}}"
},

View File

@ -448,7 +448,7 @@ const TranslatePage: FC = () => {
}
} catch (e) {
logger.error('Failed to select file and ocr.', e as Error)
window.message.error(formatErrorMessage(e))
window.message.error(t('ocr.error.unknown') + ' ' + formatErrorMessage(e))
} finally {
setIsProcessing(false)
window.message.destroy('translate_ocr_processing')