Переглянути джерело

:art: Find replace supports selecting element types https://github.com/siyuan-note/siyuan/issues/9895

Daniel 1 рік тому
батько
коміт
af53d6a73a

+ 25 - 0
app/appearance/langs/en_US.json

@@ -1,4 +1,29 @@
 {
 {
+  "replaceTypes": {
+    "text": "Normal text",
+    "imgText": "Image alt text",
+    "imgTitle": "Image title",
+    "imgSrc": "Image link",
+    "aText": "Link anchor text",
+    "aTitle": "Link title",
+    "aHref": "Link link",
+    "code": "inline code",
+    "em": "Italic",
+    "strong": "Bold",
+    "inlineMath": "Inline formula",
+    "inlineMemo": "Inline memo",
+    "kbd": "Keyboard",
+    "mark": "Mark",
+    "s": "Strikethrough",
+    "sub": "Subscript",
+    "sup": "Superscript",
+    "tag": "Tag",
+    "u": "Underline",
+    "docTitle": "Document title",
+    "codeBlock": "Code block",
+    "mathBlock": "Formula block",
+    "htmlBlock": "HTML block"
+  },
   "selected": "Selected",
   "selected": "Selected",
   "loadMore": "Load more",
   "loadMore": "Load more",
   "tempUnlock": "Temporarily unlock",
   "tempUnlock": "Temporarily unlock",

+ 25 - 0
app/appearance/langs/es_ES.json

@@ -1,4 +1,29 @@
 {
 {
+  "replaceTypes": {
+    "text": "Texto normal",
+    "imgText": "Texto alternativo de la imagen",
+    "imgTitle": "Título de la imagen",
+    "imgSrc": "Enlace de imagen",
+    "aText": "Texto ancla del enlace",
+    "aTitle": "Título del enlace",
+    "aHref": "Enlace enlace",
+    "code": "código en línea",
+    "em": "Cursiva",
+    "strong": "negrita",
+    "inlineMath": "Fórmula en línea",
+    "inlineMemo": "Nota en línea",
+    "kbd": "Teclado",
+    "mark": "Marca",
+    "s": "Tachado",
+    "sub": "Subíndice",
+    "sup": "Superíndice",
+    "tag": "Etiqueta",
+    "u": "Subrayado",
+    "docTitle": "Título del documento",
+    "codeBlock": "Bloque de código",
+    "mathBlock": "Bloque de fórmulas",
+    "htmlBlock": "bloque HTML"
+  },
   "selected": "Seleccionado",
   "selected": "Seleccionado",
   "loadMore": "Cargar más",
   "loadMore": "Cargar más",
   "tempUnlock": "Desbloquear temporalmente",
   "tempUnlock": "Desbloquear temporalmente",

+ 25 - 0
app/appearance/langs/fr_FR.json

@@ -1,4 +1,29 @@
 {
 {
+  "replaceTypes": {
+    "text": "Texte normal",
+    "imgText": "Texte alternatif de l'image",
+    "imgTitle": "Titre de l'image",
+    "imgSrc": "Lien image",
+    "aText": "Texte d'ancrage du lien",
+    "aTitle": "Titre du lien",
+    "aHref": "Lien lien",
+    "code": "code en ligne",
+    "em": "Italique",
+    "strong": "Audacieux",
+    "inlineMath": "Formule en ligne",
+    "inlineMemo": "Mémo en ligne",
+    "kbd": "Clavier",
+    "mark": "Marquer",
+    "s": "Barré",
+    "sub": "Indice",
+    "sup": "Exposant",
+    "tag": "balise",
+    "u": "Souligner",
+    "docTitle": "Titre du document",
+    "codeBlock": "Bloc de code",
+    "mathBlock": "Bloc de formule",
+    "htmlBlock": "Bloc HTML"
+  },
   "selected": "Sélectionné",
   "selected": "Sélectionné",
   "loadMore": "Charger plus",
   "loadMore": "Charger plus",
   "tempUnlock": "Déverrouiller temporairement",
   "tempUnlock": "Déverrouiller temporairement",

+ 25 - 0
app/appearance/langs/zh_CHT.json

@@ -1,4 +1,29 @@
 {
 {
+  "replaceTypes": {
+    "text": "普通文字",
+    "imgText": "圖片提示文字",
+    "imgTitle": "圖片標題",
+    "imgSrc": "圖片連結",
+    "aText": "連結錨文本",
+    "aTitle": "連結標題",
+    "aHref": "連結位址",
+    "code": "行級代碼",
+    "em": "斜體",
+    "strong": "粗體",
+    "inlineMath": "行級公式",
+    "inlineMemo": "行級備註",
+    "kbd": "鍵盤",
+    "mark": "高亮",
+    "s": "刪除",
+    "sub": "下標",
+    "sup": "上標",
+    "tag": "標籤",
+    "u": "底線",
+    "docTitle": "文檔標題",
+    "codeBlock": "程式碼區塊",
+    "mathBlock": "公式區塊",
+    "htmlBlock": "HTML 區塊"
+  },
   "selected": "已選擇",
   "selected": "已選擇",
   "loadMore": "載入更多",
   "loadMore": "載入更多",
   "tempUnlock": "暫時解鎖",
   "tempUnlock": "暫時解鎖",

+ 25 - 0
app/appearance/langs/zh_CN.json

@@ -1,4 +1,29 @@
 {
 {
+  "replaceTypes": {
+    "text": "普通文本",
+    "imgText": "图片提示文本",
+    "imgTitle": "图片标题",
+    "imgSrc": "图片链接",
+    "aText": "链接锚文本",
+    "aTitle": "链接标题",
+    "aHref": "链接地址",
+    "code": "行级代码",
+    "em": "斜体",
+    "strong": "粗体",
+    "inlineMath": "行级公式",
+    "inlineMemo": "行级备注",
+    "kbd": "键盘",
+    "mark": "高亮",
+    "s": "删除",
+    "sub": "下标",
+    "sup": "上标",
+    "tag": "标签",
+    "u": "下划线",
+    "docTitle": "文档标题",
+    "codeBlock": "代码块",
+    "mathBlock": "公式块",
+    "htmlBlock": "HTML 块"
+  },
   "selected": "已选中",
   "selected": "已选中",
   "loadMore": "加载更多",
   "loadMore": "加载更多",
   "tempUnlock": "临时解锁",
   "tempUnlock": "临时解锁",

+ 13 - 13
app/src/constants.ts

@@ -521,17 +521,17 @@ export abstract class Constants {
         [key: string]: boolean;
         [key: string]: boolean;
     } = {
     } = {
         "text": true,
         "text": true,
-        "img-text": true,
-        "img-title": true,
-        "img-src": false,
-        "a-text": true,
-        "a-title": true,
-        "a-href": false,
+        "imgText": true,
+        "imgTitle": true,
+        "imgSrc": false,
+        "aText": true,
+        "aTitle": true,
+        "aHref": false,
         "code": false,
         "code": false,
         "em": true,
         "em": true,
         "strong": true,
         "strong": true,
-        "inline-math": false,
-        "inline-memo": true,
+        "inlineMath": false,
+        "inlineMemo": true,
         "kbd": true,
         "kbd": true,
         "mark": true,
         "mark": true,
         "s": true,
         "s": true,
@@ -539,11 +539,11 @@ export abstract class Constants {
         "sup": true,
         "sup": true,
         "tag": true,
         "tag": true,
         "u": true,
         "u": true,
-        "doc-title": true,
-        "code-block": false,
-        "math-block": false,
-        "html-block": false
-    };
+        "docTitle": true,
+        "codeBlock": false,
+        "mathBlock": false,
+        "htmlBlock": false
+    }
 
 
     // image
     // image
     public static readonly SIYUAN_IMAGE_VIP: string = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
     public static readonly SIYUAN_IMAGE_VIP: string = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">

+ 1 - 1
app/src/search/menu.ts

@@ -157,7 +157,7 @@ export const replaceFilterMenu = (config: ISearchOption) => {
         html += `<label class="fn__flex b3-label">
         html += `<label class="fn__flex b3-label">
     <span class="fn__space"></span>
     <span class="fn__space"></span>
     <div class="fn__flex-1 fn__flex-center">
     <div class="fn__flex-1 fn__flex-center">
-        ${window.siyuan.languages[key]}
+        ${window.siyuan.languages.replaceTypes[key]}
     </div>
     </div>
     <span class="fn__space"></span>
     <span class="fn__space"></span>
     <input class="b3-switch fn__flex-center" data-type="${key}" type="checkbox"${config.replaceTypes[key] ? " checked" : ""}>
     <input class="b3-switch fn__flex-center" data-type="${key}" type="checkbox"${config.replaceTypes[key] ? " checked" : ""}>

+ 12 - 12
kernel/model/storage.go

@@ -190,17 +190,17 @@ type CriterionTypes struct {
 
 
 type CriterionReplaceTypes struct {
 type CriterionReplaceTypes struct {
 	Text       bool `json:"text"`
 	Text       bool `json:"text"`
-	ImgText    bool `json:"img-text"`
-	ImgTitle   bool `json:"img-title"`
-	ImgSrc     bool `json:"img-src"`
-	AText      bool `json:"a-text"`
-	ATitle     bool `json:"a-title"`
-	AHref      bool `json:"a-href"`
+	ImgText    bool `json:"imgText"`
+	ImgTitle   bool `json:"imgTitle"`
+	ImgSrc     bool `json:"imgSrc"`
+	AText      bool `json:"aText"`
+	ATitle     bool `json:"aTitle"`
+	AHref      bool `json:"aHref"`
 	Code       bool `json:"code"`
 	Code       bool `json:"code"`
 	Em         bool `json:"em"`
 	Em         bool `json:"em"`
 	Strong     bool `json:"strong"`
 	Strong     bool `json:"strong"`
-	InlineMath bool `json:"inline-math"`
-	InlineMemo bool `json:"inline-memo"`
+	InlineMath bool `json:"inlineMath"`
+	InlineMemo bool `json:"inlineMemo"`
 	Kbd        bool `json:"kbd"`
 	Kbd        bool `json:"kbd"`
 	Mark       bool `json:"mark"`
 	Mark       bool `json:"mark"`
 	S          bool `json:"s"`
 	S          bool `json:"s"`
@@ -208,10 +208,10 @@ type CriterionReplaceTypes struct {
 	Sup        bool `json:"sup"`
 	Sup        bool `json:"sup"`
 	Tag        bool `json:"tag"`
 	Tag        bool `json:"tag"`
 	U          bool `json:"u"`
 	U          bool `json:"u"`
-	DocTitle   bool `json:"doc-title"`
-	CodeBlock  bool `json:"code-block"`
-	MathBlock  bool `json:"math-block"`
-	HtmlBlock  bool `json:"html-block"`
+	DocTitle   bool `json:"docTitle"`
+	CodeBlock  bool `json:"codeBlock"`
+	MathBlock  bool `json:"mathBlock"`
+	HtmlBlock  bool `json:"htmlBlock"`
 }
 }
 
 
 var criteriaLock = sync.Mutex{}
 var criteriaLock = sync.Mutex{}