original_docstring: Translate text to another language.
docstring: Translate text to another language.
docstring_tokens: Translate text to another language .
code: def translate(self, text):
          """Translate text to another language."""
          if self._language != 'en':
              try:
                  from googletrans import Translator
                  translator = Translator()
                  ttext, reps = self.rep_ansi(text)
                  ttext = translator.translate(ttext, dest=self._language).text
                  text = ttext.format(*reps)
              except Exception:
                  pass
          return text
code_tokens: def translate ( self , text ) : if self . _language != 'en' : try : from googletrans import Translator translator = Translator ( ) ttext , reps = self . rep_ansi ( text ) ttext = translator . translate ( ttext , dest = self . _language ) . text text = ttext . format ( * reps ) except Exception : pass return text
short_docstring: Translate text to another language.
short_docstring_tokens: Translate text to another language .
comment: """Translate text to another language."""