DEV Community

loading...
Cover image for Simple Translator in Python

Simple Translator in Python

soniarpit profile image CodeSnail 🐌 ・1 min read

Installation

pip install translate
Enter fullscreen mode Exit fullscreen mode

code

from translate import Translator

translator= Translator(to_lang="Hindi")
translation = translator.translate("Follow code_snail")
print(translation)
Enter fullscreen mode Exit fullscreen mode

Between Any Two Languages

from translate import Translator

# Between Any Two Languages
translator= Translator(from_lang="hindi",to_lang="english")
translation = translator.translate("@code_snail का अनुसरण करें")
print(translation)
Enter fullscreen mode Exit fullscreen mode

Like, Follow, Comment and Code :)

Discussion (0)

pic
Editor guide