Closed nikotung closed 6 months ago
I read the codes on custom_api_translator.py. Do the source_lang and target_lang placed in the wrong position? The target_lang should be the language specified in the cli by —language, right ?
source_lang
target_lang
—language
def translate(self, text): print(text) custom_api = self.custom_api data = {"text": text, "source_lang": self.language, "target_lang": "auto"} post_data = json.dumps(data) r = requests.post(url=custom_api, data=post_data, timeout=10).text t_text = json.loads(r)["data"] print("[bold green]" + re.sub("\n{3,}", "\n\n", t_text) + "[/bold green]") time.sleep(5) return t_text
yes, can you open a PR to fix this?
I read the codes on custom_api_translator.py. Do the
source_lang
andtarget_lang
placed in the wrong position? Thetarget_lang
should be the language specified in the cli by—language
, right ?