Polyglot integration for Django Web Framework
Project description
Django-Polyglot: DeepL integration for Django
Django-Polyglot is an integration of Polyglot for Django Web Framework.
It provides a CLI command that, using the DeepL API, automates the translation of your static texts.
Installation
Django Polyglot can be easily installed by running:
pip install django-polyglot-translator
Make sure you've configured Django internationalization.
Now you have to register Django-Polyglot in your settings like this:
INSTALLED_APPS = [
...
'djangoPolyglot'
]
Finally, you need to store your DeepL API key in your settings.
POLYGLOT_DEEPL_LICENSE = "your DeepL API key"
Usage
Translate
Django-Polyglot will run for you the Django "makemessages" command, preparing the .po files with the text to be translated. Then Polyglot will use the DeepL APIs to translate this files. Finally the Django "compilemessages" command will be ran and your static translations will be ready.
./manage.py django-polyglot translate
⚠️To use the translate command you need to set LANGUAGE_CODE, LANGUAGES and LOCALE_PATHS in your settings, according the Django documentation.
Usage info
It returns DeepL usage info related to your API key, run with:
./manage.py django-polyglot print_usage_info
Supported languages
It returns the list of languages currently supported by DeepL, run with:
./manage.py django-polyglot print_supported_languages
Dependencies
The only dependency is Polyglot.
License
Django-Polyglot is provided under the MIT license.
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
File details
Details for the file django-polyglot-translator-1.2.2.tar.gz
.
File metadata
- Download URL: django-polyglot-translator-1.2.2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887c3306f4c0dcba54a96848ac6c96a297d850b1986c123009275329f20566cb |
|
MD5 | 249b94342995ec516a93f86da293ec06 |
|
BLAKE2b-256 | c6d5ccafe0ae2b37f9e631fa14cdf0819e47244fd0dd8c694eeeaefb95987b4c |
File details
Details for the file django_polyglot_translator-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: django_polyglot_translator-1.2.2-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b5b823d1c09f25362ae4131380f8348b3a3ac33ae373ff6036b08437b146557 |
|
MD5 | 00062cfefbec624a4a2b67b1420c9ba8 |
|
BLAKE2b-256 | 04afe9c6d1561f132ecc08a05a7f1457587b8e3d3e1ad14da07d3913bb0f7e27 |