A simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command using google translate.
Project description
django-autotranslate
A simple Django app to automatically translate the pot (.po
) files generated by django's makemessages command
using google translate.
Installation:
pip install django-autotranslate
Add 'autotranslate'
to your INSTALLED_APPS
setting.
INSTALLED_APPS = (
...
'autotranslate',
)
Quickstart:
python manage.py translate_messages
The command finds all the generated pot (.po
) files under the locale paths (LOCALE_PATHS
) specified in django project settings, and translates them automatically.
Options:
-f, --set-fuzzy
: Set the 'fuzzy' flag on autotranslated entries-l, --locale 'locale'
: Only translate the specified locales-u, --untranslated
: Only translate the untranslated messages
python manage.py translate_messages -l 'de' -l 'es'
Settings:
- Use a different Translation Service:
# default: 'autotranslate.services.GoSlateTranslatorService'
# pip install google-api-python-client
AUTOTRANSLATE_TRANSLATOR_SERVICE = 'autotranslate.services.GoogleAPITranslatorService'
GOOGLE_TRANSLATE_KEY = '<google-api-key>'
Compatibility Matrix:
autotranslate | django |
---|---|
v1.0.x | Django 1.5+ |
v1.1.x | Django 1.8+ |
Tests:
# run test against all environments
tox
# run test against a specific environment defined in tox.ini
# eg. django>1.9 & python3.4
tox -e dj19-py34
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-autotranslate-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8bc8f816bc22fa49d63baca5d43e33d6b38257551ca0303de76bab32d1048a1 |
|
MD5 | fba36c2003bcbb5540e9cfac1587b598 |
|
BLAKE2b-256 | 541a7ea4dd4ee84a6fcbbc87e63956f4843678a6708a1131413e8d760e3ecccf |
Close
Hashes for django_autotranslate-1.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d4691729790f91c22ccb6a005e6785cf5aa9c14a8f14be3c15262dff1631842 |
|
MD5 | 766499c94f1007b842576627b864ea38 |
|
BLAKE2b-256 | ba517a4ab50b2dc873f95c535f905bae424be436d5d2fd5910260efa17176b50 |