From 285892e915b77f9bcb14ad48faf98181242e52bb Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 19 Jul 2022 09:43:24 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=BB=86=E5=8C=96=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/5451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 4 ++-- app/appearance/langs/es_ES.json | 4 ++-- app/appearance/langs/fr_FR.json | 4 ++-- app/appearance/langs/zh_CHT.json | 4 ++-- app/appearance/langs/zh_CN.json | 4 ++-- kernel/model/sync.go | 21 ++++++++++++--------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index 4a1ec4f7e..8b5ba4b16 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -794,8 +794,8 @@ "36": "TODO", "37": "Do not include spaces and special symbols in the name of the cloud sync directory", "38": "The number of mentioned keywords [%d] is too many, currently only supports up to [512] keywords", - "39": "Deleting index [%s]", - "40": "Inserting index [%s]", + "39": "Deleting index %s", + "40": "Inserting index %s", "41": "Upload completed", "42": "The setting is complete, the application will be closed automatically, please restart later...", "43": "The maximum storage capacity of cloud space [%s] has been exceeded, and data upload cannot continue", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 4fa21a7b1..20d555338 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -794,8 +794,8 @@ "36": "TODO", "37": "No incluyas espacios ni símbolos especiales en el nombre del directorio de sincronización con la nube", "38": "El número de palabras clave mencionadas [%d] son demasiados, actualmente solo admite hasta [512] palabras clave", - "39": "Eliminando índice [%s]", - "40": "Insertando índice [%s]", + "39": "Eliminando índice %s", + "40": "Insertando índice %s", "41": "Carga completada", "42": "La configuración se ha completado, la aplicación se cerrará automáticamente, por favor reinicie más tarde...", "43": "Se ha superado la capacidad máxima de almacenamiento del espacio en la nube [%s] y la carga de datos no puede continuar", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 023b55bd1..376c48704 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -794,8 +794,8 @@ "36": "TODO", "37": "N'incluez pas d'espaces et de symboles spéciaux dans le nom du répertoire de synchronisation cloud", "38": "Le nombre de mots-clés mentionnés [%d] est trop élevé, ne prend actuellement en charge que jusqu'à [512] mots-clés", - "39": "Suppression de l'index [%s]", - "40": "Insertion de l'index [%s]", + "39": "Suppression de l'index %s", + "40": "Insertion de l'index %s", "41": "Transfert complété", "42": "Le paramétrage est terminé, l'application se fermera automatiquement, merci de redémarrer plus tard...", "43": "La capacité de stockage maximale de l'espace cloud [%s] a été dépassée et le téléchargement des données ne peut pas continuer", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index f9c3e3d2a..160b40329 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -794,8 +794,8 @@ "36": "TODO", "37": "雲端同步目錄的名稱請勿包含空格和特殊符號", "38": "提及關鍵字數量 [%d] 過多,目前最多僅支援搜索 [512] 個關鍵字", - "39": "正在刪除索引 [%s]", - "40": "正在插入索引 [%s]", + "39": "正在刪除索引 %s", + "40": "正在插入索引 %s", "41": "上傳完畢", "42": "設置完成,即將自動關閉應用,請稍後重新啟動...", "43": "已超過雲端空間最大存儲容量 [%s],無法繼續上傳數據", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index c48d21e02..ce8379b40 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -795,8 +795,8 @@ "36": "TODO", "37": "云端同步目录的名称请勿包含空格和特殊符号", "38": "提及关键字数量 [%d] 过多,目前最多仅支持搜索 [512] 个关键字", - "39": "正在删除索引 [%s]", - "40": "正在插入索引 [%s]", + "39": "正在删除索引 %s", + "40": "正在插入索引 %s", "41": "上传完毕", "42": "设置完成,即将自动关闭应用,请稍后重新启动...", "43": "已超过云端空间最大存储容量 [%s],无法继续上传数据", diff --git a/kernel/model/sync.go b/kernel/model/sync.go index 335345a18..63d6a55da 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "os/exec" + "path" "path/filepath" "strings" "sync" @@ -144,14 +145,15 @@ func incReindex(upserts, removes []string) { id := strings.TrimSuffix(filepath.Base(removeFile), ".sy") block := treenode.GetBlockTree(id) if nil != block { - util.IncBootProgress(bootProgressPart, "Sync remove tree "+block.Path) - treenode.RemoveBlockTreesByRootID(block.RootID) - sql.RemoveTreeQueue(block.BoxID, block.RootID) msg = fmt.Sprintf(Conf.Language(39), block.RootID) + util.IncBootProgress(bootProgressPart, msg) util.PushStatusBar(msg) if needPushRemoveProgress { util.PushEndlessProgress(msg) } + + treenode.RemoveBlockTreesByRootID(block.RootID) + sql.RemoveTreeQueue(block.BoxID, block.RootID) } } @@ -179,18 +181,19 @@ func incReindex(upserts, removes []string) { box := upsertFile[:idx] p := strings.TrimPrefix(upsertFile, box) - util.IncBootProgress(bootProgressPart, "Sync upsert tree "+p) + msg = fmt.Sprintf(Conf.Language(40), strings.TrimSuffix(path.Base(p), ".sy")) + util.IncBootProgress(bootProgressPart, msg) + util.PushStatusBar(msg) + if needPushUpsertProgress { + util.PushEndlessProgress(msg) + } + tree, err0 := LoadTree(box, p) if nil != err0 { continue } treenode.ReindexBlockTree(tree) sql.UpsertTreeQueue(tree) - msg = fmt.Sprintf(Conf.Language(40), tree.ID) - util.PushStatusBar(msg) - if needPushUpsertProgress { - util.PushEndlessProgress(msg) - } } util.PushStatusBar(Conf.Language(58))