DEV Community

Cover image for Simple Translator in Python
Arpit
Arpit

Posted on

Simple Translator in Python

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 :)

Top comments (0)