Skip to main content

Python API For Google Translate

 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:

  • To know the languages :
                 




It returns the dictionary of the languages.

  • How to translate:


The syntax of translate method is 
translator.translate(text, lang_tgt, lang_src)
Here,

  1. Text = Sentence/text which you want to translate.
  2. lang_tgt = key of that language in which you want to translate your text.
  3. lang_src = The language of your text. It takes auto by default.

Comments

Contact Form

Name

Email *

Message *

Popular posts from this blog

Simple Calculator Using Python

      Simple Calculator Using Python      Hello friends in this blog we will learn how we can create simple calculator using python. To create calculator we required Tkinter library which is built-in library of python. With the help of this library we can create GUI of the application.  To create calculator we follow some steps:- 1) Import all required libraries and create the basic window:- 2) Add required widgets to window:- In this step add number and operators buttons to the window. 3) Create function for each button:- In this step create separate functions for 0 to 9 numbers, operator (+,-,*,/), equals, clear buttons.      i] Function for 0 to 9 numbers:- Here we create one function for 0 to 9 numbers. We pass number as a parameter to function so that one function is enough for 0 to 9 number buttons.      ii] Function for operators(+,*,-,\):- Here we create separate functions for each operator.   ...