فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 2 سال پیش
والد
کامیت
400313b177

+ 1 - 1
app/appearance/langs/en_US.json

@@ -843,7 +843,7 @@
     "82": "Synced at %s",
     "83": "The access authorization code is incorrect",
     "84": "Backup failed: %s",
-    "85": "The file is occupied by other programs. Do not use the system file manager to open the workspace folder during operation; do not use a third-party real-time synchronization disk and check whether the workspace folder has write permissions",
+    "85": "The file is being used by other programs %s",
     "86": "Please configure [Settings - About - Access authorization code]",
     "87": "Cannot move to this location",
     "88": "Finished parsing [%d] data files, remaining to be processed [%d]",

+ 1 - 1
app/appearance/langs/es_ES.json

@@ -843,7 +843,7 @@
     "82": "Sincronizado en %s",
     "83": "El código de autorización de acceso es incorrecto",
     "84": "Copia de seguridad fallida: %s",
-    "85": "El archivo está ocupado por otros programas. No utilice el administrador de archivos del sistema para abrir la carpeta del área de trabajo durante el funcionamiento; no utilice un disco de sincronización en tiempo real de terceros y compruebe si la carpeta del área de trabajo tiene permisos de escritura",
+    "85": "El archivo está siendo utilizado por otros programas %s",
     "86": "Por favor, configure [Configuración - Acerca de - Código de autorización de acceso]",
     "87": "No se puede mover a esta ubicación",
     "88": "Se ha terminado de analizar [%d] archivos de datos, quedan por procesar [%d]",

+ 1 - 1
app/appearance/langs/fr_FR.json

@@ -843,7 +843,7 @@
     "82": "Synchronisé à %s",
     "83": "Le code d'autorisation d'accès est incorrect",
     "84": "Échec de la sauvegarde : %s",
-    "85": "Le fichier est occupé par d'autres programmes. N'utilisez pas le gestionnaire de fichiers système pour ouvrir le dossier de l'espace de travail pendant le fonctionnement ; n'utilisez pas de disque de synchronisation en temps réel tiers et vérifiez si le dossier de l'espace de travail dispose des autorisations d'écriture",
+    "85": "Le fichier est utilisé par d'autres programmes %s",
     "86": "Veuillez configurer [Paramètres - A propos de - Code d'autorisation d'accès]",
     "87": "Impossible de se déplacer vers cet endroit",
     "88": "Fin de l'analyse des fichiers de données [%d], restant à traiter [%d]",

+ 1 - 1
app/appearance/langs/zh_CHT.json

@@ -843,7 +843,7 @@
     "82": "同步於 %s",
     "83": "存取授權碼不正確",
     "84": "備份失敗:%s",
-    "85": "檔被其他程式佔用。運行期間請勿使用系統文件管理器打開工作空間文件夾;請勿使用第三方實時同步碟並檢查工作空間文件夾是否有寫入權限",
+    "85": "檔被其他程式佔用 %s",
     "86": "請先配置 [設置 - 關於 - 存取授權碼]",
     "87": "無法移動到該位置",
     "88": "已完成解析 [%d] 個數據文件,剩餘待處理 [%d]",

+ 1 - 1
app/appearance/langs/zh_CN.json

@@ -844,7 +844,7 @@
     "82": "同步于 %s",
     "83": "访问授权码不正确",
     "84": "备份失败:%s",
-    "85": "文件被其他程序占用。运行期间请勿使用系统文件管理器打开工作空间文件夹;请勿使用第三方实时同步盘并检查工作空间文件夹是否有写入权限",
+    "85": "该文件正被其他程序使用 %s",
     "86": "请先配置 [设置 - 关于 - 访问授权码]",
     "87": "无法移动到该位置",
     "88": "已完成解析 [%d] 个数据文件,剩余待处理 [%d]",

+ 1 - 1
kernel/model/box.go

@@ -453,7 +453,7 @@ func RefreshFileTree() {
 	WaitForWritingFiles()
 
 	if err := sql.InitDatabase(true); nil != err {
-		util.PushErrMsg(Conf.Language(85), 5000)
+		util.PushErrMsg(fmt.Sprintf(Conf.Language(85), err), 5000)
 		return
 	}
 

+ 3 - 3
kernel/model/repository.go

@@ -465,7 +465,7 @@ func IndexRepo(memo string) (err error) {
 	return
 }
 
-func syncRepo(boot, exit, byHand bool) {
+func syncRepo(boot, exit, byHand bool) (err error) {
 	if 1 > len(Conf.Repo.Key) {
 		syncDownloadErrCount++
 		planSyncAfter(fixSyncInterval)
@@ -591,9 +591,9 @@ func indexRepoBeforeCloudSync(repo *dejavu.Repo) (index *entity.Index, err error
 		dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBar,
 	})
 	if nil != err {
-		msg := fmt.Sprintf(Conf.Language(140), err)
+		msg := fmt.Sprintf(Conf.Language(140), formatErrorMsg(err))
 		util.PushStatusBar(msg)
-		util.PushErrMsg(msg, 5000)
+		util.PushErrMsg(msg, 12000)
 		logging.LogErrorf("index data repo before cloud sync failed: %s", err)
 		return
 	}

+ 13 - 11
kernel/model/sync.go

@@ -110,15 +110,17 @@ func SyncData(boot, exit, byHand bool) {
 	Conf.Sync.Synced = now
 
 	util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)
-	defer func() {
-		synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n" + Conf.Sync.Stat
-		msg := fmt.Sprintf(Conf.Language(82), synced)
-		Conf.Sync.Stat = msg
-		Conf.Save()
-		util.BroadcastByType("main", "syncing", 1, msg, nil)
-	}()
-
-	syncRepo(boot, exit, byHand)
+	err := syncRepo(boot, exit, byHand)
+	synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"
+	if nil == err {
+		synced += Conf.Sync.Stat
+	} else {
+		synced += fmt.Sprintf(Conf.Language(80), err)
+	}
+	msg := fmt.Sprintf(Conf.Language(82), synced)
+	Conf.Sync.Stat = msg
+	Conf.Save()
+	util.BroadcastByType("main", "syncing", 1, msg, nil)
 	return
 }
 
@@ -324,8 +326,8 @@ func formatErrorMsg(err error) string {
 	msgLowerCase := strings.ToLower(msg)
 	if strings.Contains(msgLowerCase, "permission denied") || strings.Contains(msg, "access is denied") {
 		msg = Conf.Language(33) + " " + err.Error()
-	} else if strings.Contains(msgLowerCase, "device or resource busy") {
-		msg = Conf.Language(85) + " " + err.Error()
+	} else if strings.Contains(msgLowerCase, "device or resource busy") || strings.Contains(msg, "is being used by another") {
+		msg = fmt.Sprintf(Conf.Language(85), err)
 	} else if strings.Contains(msgLowerCase, "cipher: message authentication failed") {
 		msg = Conf.Language(172) + " " + err.Error()
 	} else if strings.Contains(msgLowerCase, "repo fatal error") {