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-s, --source-language
: Override the default source language (en) used for translation
python manage.py translate_messages -l 'de' -l 'es'
Settings:
- Use a different Translation Service:
# default: 'autotranslate.services.GoogleTranslatorService'
# 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
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
File details
Details for the file django-autotranslate2-1.2.7.tar.gz
.
File metadata
- Download URL: django-autotranslate2-1.2.7.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1ca2d7f296179ea6c289585f9cb43a29ecd640b6a53887e7fcff7359dde80d0 |
|
MD5 | 9ef372d86a8335df199c62b638694dbe |
|
BLAKE2b-256 | cc74277137cfe64ed4ce55dd142c903105c27f1bf07aa3c273b8aa00a06721f2 |
File details
Details for the file django_autotranslate2-1.2.7-py3-none-any.whl
.
File metadata
- Download URL: django_autotranslate2-1.2.7-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8036db4817e58f2aab004cae8f3705cb999fe695bf66a64e2e543b80436e749 |
|
MD5 | 7e71028e2c0e8d0d3e3909d3e574bef7 |
|
BLAKE2b-256 | b016e81397a81dcbd8eaad1d2e6be10231e5a6a675c5def8a23e7ac4eae25ad3 |