MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / do_translate

Method do_translate

pdf2zh/translator.py:681–688  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

679 logger.setLevel(logging.WARNING)
680
681 def do_translate(self, text) -> str:
682 response = self.client.translate(
683 body=[text],
684 from_language=self.lang_in,
685 to_language=[self.lang_out],
686 )
687 translated_text = response[0].translations[0].text
688 return translated_text
689
690
691class TencentTranslator(BaseTranslator):

Callers

nothing calls this directly

Calls 1

translateMethod · 0.45

Tested by

no test coverage detected