Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-polyglot-translator-1.2.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-polyglot-translator-1.2.1.tar.gz.

File metadata

File hashes

Hashes for django-polyglot-translator-1.2.1.tar.gz
Algorithm Hash digest
SHA256 dc5bd4375e1babd8d373071ee40b8cc90d9586bcbe5ab7c5696d4b2ee8d37cbc
MD5 37f0254bfa904b9f48e22556826835e7
BLAKE2b-256 e5520c683d2f02851a26ea39321aca5144ac3e51ef3646a110af5b1a8aa530b3

See more details on using hashes here.

File details

Details for the file django_polyglot_translator-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_polyglot_translator-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2bca02ac02bd3076a9f44879de00b1ee5847064bfa5da7a1781ca1c41e758d
MD5 4853e3b9925573e3f92cc68356ce4d0d
BLAKE2b-256 6eda9b851628e06c92112d847626d14ba79216d75d1dc631c93d3b8c995bffd8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page