Build a language translator with just 3 lines

Googletrans 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. Link

We can use Free Google Translate API in Python, which is a fr…


This content originally appeared on DEV Community and was authored by Wulfi

Googletrans 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. Link

We can use Free Google Translate API in Python, which is a free of charge translator. Link

We need to install the API:

$ pip install googletrans

Let us try to translate "Hello" to Japanese, simply say:

from googletrans import Translator
translator = Translator()
result = translator.translate("Hello", dest="ja")

print(result)

In the above, we can specify any language code for 'dest' value. Get the supported language codes from the documentation


This content originally appeared on DEV Community and was authored by Wulfi


Print Share Comment Cite Upload Translate Updates
APA

Wulfi | Sciencx (2022-02-08T15:07:12+00:00) Build a language translator with just 3 lines. Retrieved from https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/

MLA
" » Build a language translator with just 3 lines." Wulfi | Sciencx - Tuesday February 8, 2022, https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/
HARVARD
Wulfi | Sciencx Tuesday February 8, 2022 » Build a language translator with just 3 lines., viewed ,<https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/>
VANCOUVER
Wulfi | Sciencx - » Build a language translator with just 3 lines. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/
CHICAGO
" » Build a language translator with just 3 lines." Wulfi | Sciencx - Accessed . https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/
IEEE
" » Build a language translator with just 3 lines." Wulfi | Sciencx [Online]. Available: https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/. [Accessed: ]
rf:citation
» Build a language translator with just 3 lines | Wulfi | Sciencx | https://www.scien.cx/2022/02/08/build-a-language-translator-with-just-3-lines/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.