Skip to content

Commit ea630ab

Browse files
committed
:globe_with_maridians: 更新 i18n
1 parent eb128fd commit ea630ab

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.github/workflows/build_and_publish.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,3 @@ jobs:
6767
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
6868
git commit -a -m ":sparkles: 更新 VERSION"
6969
git push
70-
71-
72-

core/cluster.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ async def clear_cache(self):
577577
return
578578
for key in old_keys:
579579
self.cache.pop(key)
580-
logger.info(
581-
f"Outdated caches: {unit.format_number(len(old_keys))}({unit.format_bytes(old_size)})."
582-
)
580+
logger.info(locale.t("cluster.info.clear_cache.count",
581+
count=unit.format_number(len(old_keys)),
582+
size=unit.format_bytes(old_size)))
583583

584584
async def get_files(self, dir: str) -> list[str]:
585585
files = []
@@ -648,15 +648,17 @@ def __init__(
648648
async def _keepalive(self):
649649
try:
650650
info = await asyncio.wait_for(self.session.info(self.endpoint), timeout=5)
651+
hostname = self.hostname
652+
endpoint = self.endpoint
651653
if not self.disabled:
652-
logger.success(f"[Webdav <hostname: {self.hostname}, endpoint: {self.endpoint}>] Successfully keep alive")
654+
logger.success(locale.t("cluster.success.webdav.keepalive", hostname=hostname, endpoint=endpoint))
653655
else:
654-
logger.success(f"[Webdav <hostname: {self.hostname}, endpoint: {self.endpoint}>] Successfully enable.")
655656
storages.enable(self)
657+
logger.success(locale.t("cluster.success.webdav.enabled", hostname=hostname, endpoint=endpoint))
656658
await self._list_all()
657659
except webdav3_exceptions.NoConnection:
658660
if not self.disabled:
659-
logger.success(f"[Webdav <hostname: {self.hostname}, endpoint: {self.endpoint}>] Failed to keep alive, disabled.")
661+
logger.warn(locale.t("cluster.warn.webdav.no_connection", hostname=hostname, endpoint=endpoint))
660662
storages.disable(self)
661663
self.fetch = False
662664
except:
@@ -665,7 +667,7 @@ async def _execute(self, target):
665667
try:
666668
return await target
667669
except webdav3_exceptions.NoConnection as e:
668-
logger.success(f"[Webdav <hostname: {self.hostname}, endpoint: {self.endpoint}>] Failed to connection, disable.")
670+
logger.warn(locale.t("cluster.warn.webdav.no_connection", hostname=hostname, endpoint=endpoint))
669671
storages.disable(self)
670672
self.fetch = False
671673
raise e

i18n/zh_cn.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"cluster.error.check_files.failed_to_copy": "无法复制缺失文件:$hash ($file) => $hash ($target)。",
2727
"cluster.success.check_files.finished": "已检查所有文件:$count ($size)!",
2828
"cluster.info.check_files.missing": "文件缺失:$count。",
29+
"cluster.info.clear_cache.count": "过期缓存:$count ($size)。",
2930
"cluster.tqdm.desc.cleaning_cache": "清除缓存中",
3031
"cluster.tqdm.desc.parsing_file_list": "解析文件列表中",
31-
"cluster.tqdm.desc.fetching_webdav_files": "获取 WebDav <endpoint: '$endpoint'> 文件列表中",
32+
"cluster.tqdm.desc.fetching_webdav_files": "获取 WebDAV <endpoint: '$endpoint'> 文件列表中",
3233
"i18n.prompt.failed": "(错误:无法找到该 i18n 字符串)",
3334
"cluster.info.cluster.remote_message": "[总控]: $message",
3435
"cluster.error.cluster.remote_message": "[总控]: $message",
@@ -51,6 +52,9 @@
5152
"cluster.success.check_update.new_version": "发现新版本:$latest!",
5253
"cluster.info.check_update.already_up_to_date": "当前已是最新版本。",
5354
"cluster.error.check_update.failed": "在尝试获取最新版本是遇到了错误:$e。",
55+
"cluster.success.webdav.keepalive": "WebDAV <hostname: $hostname, endpoint: $endpoint> 保活成功。",
56+
"cluster.warn.webdav.no_connection": "无法连接至 WebDAV <hostname: $hostname, endpoint: $endpoint>,正在关闭储存……",
57+
"cluster.success.webdav.enabled": "WebDAV <hostname: $hostname, endpoint: $endpoint> 成功启用。",
5458
"timer.info.task.freezing": "正在冻结任务 <$task>。",
5559
"timer.info.task.freezed": "已冻结任务 <$task>。",
5660
"plugins.info.attempt_loading": "准备加载插件中……",

0 commit comments

Comments
 (0)