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

Countdown Timer Using Tkinter

Countdown Timer Using Tkinter With the help of tkinter we create a countdown timer project for beginners. Tkinter is the built in python package. Tkinter provides GUI (Graphical User Interface)toolkit. With the help of this developer can create any GUI projects.  Steps of the Project: 1. import tkinter package 2. create a basic gui  3. add entry for Hrs, Mins, & Secs. and start button 4.  Create a function containing logic of timer   Step 1: Importing required packages   Step 2: Create Basic GUI  Step 3: Adding entry for Hrs. Mins. & Secs. and declare variable to store this values. Step 4: Create a function to perform timer. This is how we create countdown timer using python tkinter.  In this project we use divmod() function. This function helps to calculate quotient and remainder both. for example:- 1.print(divmod(25,5)) => (5,0) 2.print(divmod(5,2)) => (2,1) In the first example 25 is divided by 5 so quotient is 5 & remainder i...