django-deep-translator
Autotranslate django .po translation files package built on top of deep-translator
Installation
pip install django-deep-translator
Add 'django_deep_translator' to your INSTALLED_APPS setting:
INSTALLED_APPS = (
...
'django_deep_translator',
)
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 with default source language as english.
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
In your settings, list the relative path to locale folders, example:
LOCALE_PATHS = (
'locale',
'home/locale',
'products/locale',
'services/locale',
)
Using a different Translation Service:
# default: 'django_deep_translator.services.GoogleTranslatorService'
PO_TRANSLATOR_SERVICE = 'django_deep_translator.services.GoogleAPITranslatorService'
PO_TRANSLATOR_SERVICE accepts the following services with respective additional variables:
| Service | Additional variables | Description |
|---|---|---|
| GoogleAPITranslatorService | - | - |
| MicrosoftTranslatorService | MICROSOFT_TRANSLATE_KEY |
You need to require an api key if you want to use the microsoft translator. Visit the official website for more information about how to get one. Microsoft offers a free tier 0 subscription (2 million characters per month). |
| PonsTranslatorService | - | - |
| MyMemoryTranslatorService | - | - |
| YandexTranslatorService | YANDEX_TRANSLATE_KEY |
You need to require a private api key if you want to use the yandex translator. Visit the official website for more information about how to get one |
| PapagoTranslatorService | PAPAGO_CLIENT_ID, PAPAGO_SECRET_KEY |
You need to require a client id if you want to use the papago translator. Visit the official website for more information about how to get one. |
| DeeplTranslatorService | DEEPL_TRANSLATE_KEY |
Visit https://www.deepl.com/en/docs-api/ for more information on how to generate your Deepl api key |
| QcriTranslatorService | QCRI_TRANSLATE_KEY |
Visit https://mt.qcri.org/api/ for more information |
| LibreTranslatorservice | LIBRE_TRANSLATE_MIRROR_URL |
Libre translate has multiple mirrors which can be used for the API endpoint. Some require an API key to be used. By default the base url is set to libretranslate.de . |
Metadata
Release files for django-deep-translator 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_deep_translator-1.5.2.tar.gz | 8.8 kB | Without provenance | Details for django_deep_translator-1.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_deep_translator-1.5.2-py3-none-any.whl | Python 3 | none | any | Details for django_deep_translator-1.5.2-py3-none-any.whl |
Total release size: 18.3 kB
Release files / django_deep_translator-1.5.2.tar.gz
| Download URL | django_deep_translator-1.5.2.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8ef5642049579783121347d318859045a6d8bf81607a5b4a1712dcbc8d8b3c0
|
|
BLAKE2b-256 checksum How to use checksums |
d59d4a01868bbf427ca8ad40588e2a20be87da1869ac65caac3ad33287637ab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / django_deep_translator-1.5.2-py3-none-any.whl
| Download URL | django_deep_translator-1.5.2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64923e1915650b2cc0430907e7062242dd9ed918ed5ca80c9c94fef7bf9929f4
|
|
BLAKE2b-256 checksum How to use checksums |
e6e9e57e00eaa9aa9cd2abd8f35e528b3064e832a0e22295b0a09294cf67cdcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for django-deep-translator 1.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.