mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 23:59:45 +08:00
feat(翻译页面): 添加OCR处理中的加载状态提示
在翻译页面中添加OCR处理时的加载状态提示,提升用户体验
This commit is contained in:
parent
c5d7d7b849
commit
377d75366e
@ -1561,7 +1561,8 @@
|
|||||||
"ocr": {
|
"ocr": {
|
||||||
"file": {
|
"file": {
|
||||||
"not_supported": "不支持的文件类型 {{type}}"
|
"not_supported": "不支持的文件类型 {{type}}"
|
||||||
}
|
},
|
||||||
|
"processing": "OCR 处理中..."
|
||||||
},
|
},
|
||||||
"ollama": {
|
"ollama": {
|
||||||
"keep_alive_time": {
|
"keep_alive_time": {
|
||||||
|
|||||||
@ -440,6 +440,7 @@ const TranslatePage: FC = () => {
|
|||||||
try {
|
try {
|
||||||
const [file] = await onSelectFile({ multipleSelections: false })
|
const [file] = await onSelectFile({ multipleSelections: false })
|
||||||
if (isSupportedOcrFile(file)) {
|
if (isSupportedOcrFile(file)) {
|
||||||
|
window.message.loading({ content: t('ocr.processing'), key: 'translate_ocr_processing' })
|
||||||
const ocrResult = await ocr(file)
|
const ocrResult = await ocr(file)
|
||||||
setText(ocrResult.text)
|
setText(ocrResult.text)
|
||||||
} else {
|
} else {
|
||||||
@ -450,6 +451,7 @@ const TranslatePage: FC = () => {
|
|||||||
window.message.error(formatErrorMessage(e))
|
window.message.error(formatErrorMessage(e))
|
||||||
} finally {
|
} finally {
|
||||||
setIsProcessing(false)
|
setIsProcessing(false)
|
||||||
|
window.message.destroy('translate_ocr_processing')
|
||||||
}
|
}
|
||||||
}, [ocr, onSelectFile, selecting, t])
|
}, [ocr, onSelectFile, selecting, t])
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user