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

Mail Sending Using Tkinter

 Mail Sending Using Tkinter In this Blog We will learn how to send email through tkinter. Tkinter provides GUI toolkit. With the help of this we can create so many GUI applications.  In this blog we create the mail sending application using tkinter. Steps of the project: 1. Import required packages and library 2. Create basic GUI 3. Add required widgets to GUI. 4. Create a function for mail sending. 1. Import required packages and library: 2. Create basic GUI: 3.  Add required widgets to GUI.: 4. Create a function for mail sending. Output: smtplib: smtplib is the python built in library for sending and receiving the mail. SMTP stands for Simple Mail Transfer Protocol.  smtplib.SMTP(domain,port):  In this method add domain which you want for example gmail.com. SMTP has three ports which are 25, 465 and 587 by using this three ports we can send the mail.  smtplib.login(userid,password): This method logins to your account.And send mail from this email id....