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
File details
Details for the file arvin-django-autotranslate-1.4.0.tar.gz
.
File metadata
- Download URL: arvin-django-autotranslate-1.4.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e05854cd4453ba6c26706036c5dcb4b315f8d82ff27cfc382f64b5d4f4f9cf |
|
MD5 | e82aec32e789c53c44ac679ee898a211 |
|
BLAKE2b-256 | feb888fdf19fa852c2249f2a4d11a44a647abe6111f70c739dbc6511b46eaf1d |