diff --git a/ADC_function.py b/ADC_function.py index e69db37..5b099ef 100644 --- a/ADC_function.py +++ b/ADC_function.py @@ -301,7 +301,7 @@ def get_html_by_scraper(url: str = None, cookies: dict = None, ua: str = None, r def translate( src: str, - target_language: str = "zh_cn", + target_language: str = config.getInstance().get_target_language(), engine: str = "google-free", app_id: str = "", key: str = "", diff --git a/config.ini b/config.ini index 857079c..db4230e 100755 --- a/config.ini +++ b/config.ini @@ -71,7 +71,8 @@ switch = 0 switch = 0 ;可选项 google-free,azure,deeplx engine = google-free -; azure翻译密钥 +target_language = zh_cn +; azure翻译密钥key key = ; 翻译延迟 delay = 1 diff --git a/config.py b/config.py index c655135..22bec56 100644 --- a/config.py +++ b/config.py @@ -279,6 +279,9 @@ class Config: def get_translate_engine(self) -> str: return self.conf.get("translate", "engine") + def get_target_language(self) -> str: + return self.conf.get("translate", "target_language") + # def get_translate_appId(self) ->str: # return self.conf.get("translate","appid")