A simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command using google translate.
Project description
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>'
Tests
Tests should run with tox >=1.8. Running tox will run all tests for all environments. Use tox -e <env> to run a certain environment, a list of all environments can be found with tox -l.
Hint: it is possible to run all environments in parallel with detox.
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
Hashes for django-autotranslate-0.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e99b82fc1908032ddd73364153693776257ea1a57892afbd0d3bd70d0039236a |
|
MD5 | 969671c968782495c66b3e5bd336e9f5 |
|
BLAKE2b-256 | 58fc1e49745d48737aa7c17f5d8ff1e8126652b0c1cf8d878107680e89f52aad |