Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Add OCR-related operations to the picture menu https://github.com/siyuan-note/siyuan/issues/7203

Liang Ding867852a4623b
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 227634adda..b5b19c169c 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1,4 +1,6 @@
{
+ "ocrResult": "OCR result text",
+ "reOCR": "Re OCR",
"continueReview1": "Continue Review",
"continueReview2": "There are still <code class='fn__code'>${count}</code> cards to review, continue?",
"whatsNewInSiYuan": "What's New in SiYuan",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index ae37165333..03f1c853ba 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1,4 +1,7 @@
{
+ "ocrResult": "Texte du résultat OCR",
+ "ocrResult": "Texto de resultado de OCR",
+ "reOCR": "Re-OCR",
"continueReview1": "Continuar revisión",
"continueReview2": "Todavía hay tarjetas <code class='fn__code'>${count}</code> para revisar, ¿continuar?",
"whatsNewInSiYuan": "Novedades en SiYuan",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 33fa8f90ae..e5db150a76 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1,4 +1,5 @@
{
+ "reOCR": "ReOCR",
"continueReview1": "Continuer la révision",
"continueReview2": "Il reste encore des fiches <code class='fn__code'>${count}</code> à examiner, continuer ?",
"whatsNewInSiYuan": "Quoi de neuf dans SiYuan",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 4ccff5ccc4..7ae306d544 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1,4 +1,6 @@
{
+ "ocrResult": "OCR 結果文本",
+ "reOCR": "重新 OCR",
"continueReview1": "繼續複習",
"continueReview2": "還有 <code class='fn__code'>${count}</code> 張卡片待複習,是否繼續?",
"whatsNewInSiYuan": "思源筆記最新變化",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index c847b8535c..110285058b 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,4 +1,6 @@
{
+ "ocrResult": "OCR 结果文本",
+ "reOCR": "重新 OCR",
"continueReview1": "继续复习",
"continueReview2": "还有 <code class='fn__code'>${count}</code> 张卡片待复习,是否继续?",
"whatsNewInSiYuan": "思源笔记最新变化",
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 42e6fc5238..ead26e5adc 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -593,7 +593,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
label: "OCR",
submenu: [{
iconHTML: Constants.ZWSP,
- label: window.siyuan.languages.refresh,
+ label: window.siyuan.languages.reOCR,
click() {
fetchPost("/api/asset/getImageOCRText", {
path: imgElement.getAttribute("src"),
@@ -602,7 +602,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
}
}, {
iconHTML: Constants.ZWSP,
- label: `<div class="fn__hr--small"></div><textarea data-type="ocr" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.update}"></textarea><div class="fn__hr--small"></div>`,
+ label: `<div class="fn__hr--small"></div><textarea data-type="ocr" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.ocrResult}"></textarea><div class="fn__hr--small"></div>`,
bind(element) {
fetchPost("/api/asset/getImageOCRText", {
path: imgElement.getAttribute("src"),