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
Close
Hashes for arvin-django-autotranslate-1.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22e392b9648bbb0e0ebf03b950e36d3b778347a60bfa67b82760c839bf356c0f |
|
MD5 | 3674ade861008a47f3bca8ada88d316d |
|
BLAKE2b-256 | 825a1dcde97222b463dea0dc85927fa1543b0bf7de372bff15ac23bf98303083 |