python3 googletrans
#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