Python Google Translate API
Hello Friends in this blog we will learn about Python API for translation. With the help of this API we can translate any language like google translator.
The name of this API is google-trans-new.
How to install this API:
>>> pip install google_trans_new
Insert this command in your command prompt to install this.
How it works:
It returns the dictionary of the languages.
- How to translate:
The syntax of translate method is
translator.translate(text, lang_tgt, lang_src)
Here,
- Text = Sentence/text which you want to translate.
- lang_tgt = key of that language in which you want to translate your text.
- lang_src = The language of your text. It takes auto by default.
Comments
Post a Comment