0
votes

I am using Django to create a project where I can change the language of website where user can use the page in any language they are comfortable with. But I am not sure how to implement google translate API in Django can anyone help me. I know that we can install google translation API using

"$ pip install googletrans"

but how can we implement this in Django framework. I am new to python. Thank you in advance.

2
Hello! Please, have a look for the official documentation, where you can find information regarding Python client library. Additionally, check step-by-step tutorial on YT: youtube.com/watch?v=YapTts_An9A Let me know if you find it useful.aga

2 Answers

0
votes

there is a pip package which you can import in your templates and there will be google translate button. django-google-translate visit this and you will find more information.

0
votes

you can use googletrans library. Here I include the library. https://pypi.org/project/googletrans/ Here the documentation also availabe. It is easy to use.

pip install googletrans

    from googletrans import Translator

    translator = Translator()
    data = await translator.translate('යුනිකෝඩ් ', dest='ec', src='si').text()