From 1f70b6e94d64672c6dedda78392a8fdff309091d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 17 Jul 2022 21:36:41 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=B3=BB=E7=BB=9F=E5=94=A4=E9=86=92?= =?UTF-8?q?=E5=90=8E=E7=BD=91=E7=BB=9C=E6=8A=A5=E9=94=99=20`no=20such=20ho?= =?UTF-8?q?st`=20Fix=20https://github.com/siyuan-note/siyuan/issues/5442?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 2 +- app/appearance/langs/fr_FR.json | 2 +- app/appearance/langs/zh_CHT.json | 2 +- app/appearance/langs/zh_CN.json | 2 +- kernel/model/sync.go | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index f9f966105..09c8a47e1 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -779,7 +779,7 @@ "21": "Please enter the captcha", "22": "The captcha is incorrect", "23": "The data repo is damaged due to external changes (such as using a third-party real-time synchronization disk), please reset the data repo", - "24": "TODO", + "24": "The network is abnormal, please try again later", "25": "The attribute name only supports English letters and digits", "26": "Please initialize the data repo key first in [Settings - About - Data repo key]", "27": "Data integrity check failed", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 22eb9e1cd..7a9d198b3 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -779,7 +779,7 @@ "21": "Por favor ingrese el captcha", "22": "El captcha es incorrecto", "23": "El repositorio de datos está dañado debido a cambios externos (como el uso de un disco de sincronización en tiempo real de terceros), restablezca el repositorio de datos", - "24": "TODO", + "24": "La red es anómala, inténtalo de nuevo más tarde", "25": "El nombre del atributo sólo admite letras y dígitos en inglés", "26": "Por favor, inicialice primero la clave de repositorio de datos en [Configuración - Acerca de - Clave de repositorio de datos]", "27": "Falló la comprobación de la integridad de los datos", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 07eeb70f1..5f08ebd57 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -779,7 +779,7 @@ "21": "Veuillez entrer le captcha", "22": "Le captcha est incorrect", "23": "Le référentiel de données est endommagé en raison de modifications externes (comme l'utilisation d'un disque de synchronisation en temps réel tiers), veuillez réinitialiser le référentiel de données", - "24": "TODO", + "24": "Le réseau est anormal, veuillez réessayer plus tard", "25": "Le nom de l'attribut ne supporte que les lettres et les chiffres anglais.", "26": "Veuillez d'abord initialiser la clé du référentiel de données dans [Paramètres - À propos - Clé du référentiel de données]", "27": "La vérification de l'intégrité des données a échoué", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 338df42e9..9bb860f42 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -779,7 +779,7 @@ "21": "請輸入驗證碼", "22": "驗證碼不正確", "23": "數據倉庫因為外部變更損壞(比如使用第三方實時同步盤),請重置數據倉庫", - "24": "TODO", + "24": "網絡異常,請稍後再試", "25": "屬性名僅支援英文字母和阿拉伯數字", "26": "請先在 [設置 - 關於 - 數據倉庫密鑰] 中初始化數據倉庫密鑰", "27": "數據完整性校驗失敗", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 9c370413f..dc0981928 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -780,7 +780,7 @@ "21": "请输入验证码", "22": "验证码不正确", "23": "数据仓库因为外部变更损坏(比如使用第三方实时同步盘),请重置数据仓库", - "24": "TODO", + "24": "网络异常,请稍后再试", "25": "属性名仅支持英文字母和阿拉伯数字", "26": "请先在 [设置 - 关于 - 数据仓库密钥] 中初始化数据仓库密钥", "27": "数据完整性校验失败", diff --git a/kernel/model/sync.go b/kernel/model/sync.go index 2302d3884..b960d0021 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -299,6 +299,8 @@ func formatErrorMsg(err error) string { msg = Conf.Language(172) + " " + err.Error() } else if strings.Contains(msg, "repo fatal error") { msg = Conf.Language(23) + " " + err.Error() + } else if strings.Contains(msg, "no such host") || strings.Contains(msg, "connection failed") { + msg = Conf.Language(24) } msg = msg + " v" + util.Ver return msg