Google Translate in Python
How to Translate your Documents with Google Translate
Published in
3 min readOct 4, 2020
All of us are aware of Google Translate. Today, we will provide examples of how we can use the googletrans which is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make calls to such methods as detect and translate .
The first thing that we need to do is to install the googletrans library. I suggest to use the conda install command.
conda install -c conda-forge googletrans
How to get the supported languages
Google Translate supports more than 100 languages. Below, we give an example of how you can get the supported language and their corresponding code:
import pandas as pd
import googletrans
from googletrans import Translatortranslator = Translator()pd.set_option('max_colwidth', 300)# how to get the supported language and their corresponing code…