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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-autotranslate-1.2.0.tar.gz.
File metadata
- Download URL: django-autotranslate-1.2.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f306acd3a722936afecd7e4240e5bb1ee3e4b3f493916062b618b820006a02bd
|
|
| MD5 |
efc498b38b5a3d84cf63ae425aaf4fb0
|
|
| BLAKE2b-256 |
1ed2a11f13ca6dc5bb7244187134099992f30159af34b87a140cc3d2a433d0da
|
File details
Details for the file django_autotranslate-1.2.0-py3-none-any.whl.
File metadata
- Download URL: django_autotranslate-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
477c16f67ba622319fea9d80e0a8972e579f85586682b38ef344b2028d3f07c9
|
|
| MD5 |
2c98218a614d47f11f482e185e3b8f7b
|
|
| BLAKE2b-256 |
557e8bbdac30c0a41f7e8ba9fdc58e277d1f0c1ca0e1a3f3c8258478c5643a4b
|