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

The function `translate_strings` returns wrong value then it called twice #12

Closed generalov closed 4 years ago

generalov commented 8 years ago
from autotranslate.services import translate_strings

res1 = translate_strings(['Hello'], 'de', 'en', False)
res2 = translate_strings(['Hello'], 'fr', 'en', False)

https://github.com/ankitpopli1891/django-autotranslate/blob/de4c2c9ba0c22eb38bfa6b05d4ee81f78a371d3c/autotranslate/services.py#L77

The result of the first call contains one translation into 'de' language as expected. But the result of the second call contains two translations and the first result element is the translation into 'de' language from the first function call. It seems the function accomulates results between calls. I expect the result for the second function call has only one translation into 'fr' language.

github-actions[bot] commented 4 years ago

Stale issue message