ankitpopli1891 / django-autotranslate

A simple Django app to automatically translate the pot (.po) files generated by django's makemessages command using google translate.
https://ankitpopli1891.github.io/django-autotranslate/
MIT License
70 stars 39 forks source link

Add argument --source-language to override the hardcoded default "en" #32

Closed pogowurst closed 3 years ago

pogowurst commented 3 years ago

This is a minor change to make the hardcoded source_language configurable. Use case: If a Django applications translatable strings have been written in a language other than English, the management command fails when translating to English with: googleapiclient.errors.HttpError: <HttpError 400 when requesting https://translation.googleapis.com/language/translate/v2?source=en&target=en&q=...&key=...&alt=json returned "Bad language pair: en|en". Details: "[{'message': 'Bad language pair: en|en', 'domain': 'global', 'reason': 'badRequest'}]">

ivanmviveros commented 3 years ago

@ankitpopli1891 is the repository still maintained?

ankitpopli1891 commented 3 years ago

@pogowurst Thank you so much for the PR. LGTM!

@ivanmviveros Not really. I try to come in and cut the releases whenever a new PR is made, like this one.

I'll try to release this over the weekend.