RicardasSim icon

python3 googletrans

RicardasSim | PRO | 07/26/25 04:28:07 PM UTC (Edited) | 0 ⭐ | 1995 👁️ | Never ⏰ | []
Python |

480 B

|

None

|

0 👍

/

0 👎

#pip install googletrans
 
import asyncio
from googletrans import Translator
 
async def TranslateText(text_to_translate):
  async with Translator() as translator:
    result = await translator.translate(text_to_translate, src="en", dest="lt")
    return result.text
 
text_src = "In the velvet silence of deep space, ancient galaxies whisper secrets, as nebulae drift like forgotten dreams across the fabric of time."
text_dest = asyncio.run(TranslateText(text_src))
print(text_dest)

Comments