Add new translation key for 'remove_directory_failed' in English, Simplified Chinese, and Traditional Chinese locales to enhance error messaging consistency.

This commit is contained in:
yeongpin 2025-03-28 19:26:58 +08:00
parent 4587fd9373
commit 1c1174fa6c
4 changed files with 10 additions and 7 deletions

View File

@ -91,7 +91,8 @@ class AutoUpdateDisabler:
except Exception as e: except Exception as e:
print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('update.remove_directory_failed', error=str(e)) if self.translator else f'删除目录失败: {e}'}{Style.RESET_ALL}") print(f"{Fore.RED}{EMOJI['ERROR']} {self.translator.get('update.remove_directory_failed', error=str(e)) if self.translator else f'删除目录失败: {e}'}{Style.RESET_ALL}")
return False # 即使删除失败,也返回 True继续执行下一步
return True
def _clear_update_yml_file(self): def _clear_update_yml_file(self):
"""Clear update.yml file""" """Clear update.yml file"""
@ -169,9 +170,8 @@ class AutoUpdateDisabler:
if not self._kill_cursor_processes(): if not self._kill_cursor_processes():
return False return False
# 2. Delete directory # 2. Delete directory - 即使失败也继续执行
if not self._remove_updater_directory(): self._remove_updater_directory()
return False
# 3. Clear update.yml file # 3. Clear update.yml file
if not self._clear_update_yml_file(): if not self._clear_update_yml_file():

View File

@ -292,7 +292,8 @@
"update_yml_cleared": "update.yml file cleared", "update_yml_cleared": "update.yml file cleared",
"update_yml_not_found": "update.yml file not found", "update_yml_not_found": "update.yml file not found",
"clear_update_yml_failed": "Failed to clear update.yml file: {error}", "clear_update_yml_failed": "Failed to clear update.yml file: {error}",
"unsupported_os": "Unsupported OS: {system}" "unsupported_os": "Unsupported OS: {system}",
"remove_directory_failed": "Failed to remove directory: {error}"
}, },
"updater": { "updater": {
"checking": "Checking for updates...", "checking": "Checking for updates...",

View File

@ -287,7 +287,8 @@
"update_yml_cleared": "update.yml 文件已清空", "update_yml_cleared": "update.yml 文件已清空",
"update_yml_not_found": "update.yml 文件未找到", "update_yml_not_found": "update.yml 文件未找到",
"clear_update_yml_failed": "清空 update.yml 文件失败: {error}", "clear_update_yml_failed": "清空 update.yml 文件失败: {error}",
"unsupported_os": "不支持的操作系统: {system}" "unsupported_os": "不支持的操作系统: {system}",
"remove_directory_failed": "删除目录失败: {error}"
}, },
"updater": { "updater": {
"checking": "检查更新...", "checking": "检查更新...",

View File

@ -266,7 +266,8 @@
"update_yml_cleared": "update.yml 文件已清空", "update_yml_cleared": "update.yml 文件已清空",
"update_yml_not_found": "update.yml 文件未找到", "update_yml_not_found": "update.yml 文件未找到",
"clear_update_yml_failed": "清空 update.yml 文件失败: {error}", "clear_update_yml_failed": "清空 update.yml 文件失败: {error}",
"unsupported_os": "不支持的操作系统: {system}" "unsupported_os": "不支持的操作系统: {system}",
"remove_directory_failed": "刪除目錄失败: {error}"
}, },
"updater": { "updater": {
"checking": "檢查更新...", "checking": "檢查更新...",