mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2026-03-22 06:57:16 +08:00
style: 代码格式化和字符串处理优化
- 优化代码缩进和换行,提高可读性 - 统一使用单引号或双引号,保持一致性 - 移除冗余的空格和括号,精简代码
This commit is contained in:
@@ -18,7 +18,7 @@ class TranslationManager:
|
||||
def __init__(self, domain="xhs", localedir=None):
|
||||
self.domain = domain
|
||||
if not localedir:
|
||||
localedir = ROOT.joinpath('locale')
|
||||
localedir = ROOT.joinpath("locale")
|
||||
self.localedir = Path(localedir)
|
||||
self.current_translator = self.setup_translation(
|
||||
self.get_language_code(),
|
||||
@@ -41,7 +41,8 @@ class TranslationManager:
|
||||
)
|
||||
except FileNotFoundError as e:
|
||||
print(
|
||||
f"Warning: Translation files for '{self.domain}' not found. Error: {e}")
|
||||
f"Warning: Translation files for '{self.domain}' not found. Error: {e}"
|
||||
)
|
||||
return translation(self.domain, fallback=True)
|
||||
|
||||
def switch_language(self, language: str = "en_US"):
|
||||
|
||||
Reference in New Issue
Block a user