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.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
django-autotranslate-1.2.0.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for django-autotranslate-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f306acd3a722936afecd7e4240e5bb1ee3e4b3f493916062b618b820006a02bd |
|
MD5 | efc498b38b5a3d84cf63ae425aaf4fb0 |
|
BLAKE2b-256 | 1ed2a11f13ca6dc5bb7244187134099992f30159af34b87a140cc3d2a433d0da |
Close
Hashes for django_autotranslate-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 477c16f67ba622319fea9d80e0a8972e579f85586682b38ef344b2028d3f07c9 |
|
MD5 | 2c98218a614d47f11f482e185e3b8f7b |
|
BLAKE2b-256 | 557e8bbdac30c0a41f7e8ba9fdc58e277d1f0c1ca0e1a3f3c8258478c5643a4b |