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 = {
    'key' : 'your_key',
    'version' : 'free' # Write "pro" if you're using the pro version.
}

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.1.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: django-polyglot-translator-1.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for django-polyglot-translator-1.1.3.tar.gz
Algorithm Hash digest
SHA256 4dafc617542795f94c0219a29db28406a47ed2c64b2cdd0f5b599c29a06c09a0
MD5 2fc0fad598fe8a7e47c76fc26a24ccb3
BLAKE2b-256 fca96e5820cf33ecc57bae92a4950f0ba7f8724439ceac0f7555f1f31ae3f447

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_polyglot_translator-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for django_polyglot_translator-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 106fb002a7abe0973ed8e30efa01ed0fa0d943db6209c5cdd29f1fd0da08ff7d
MD5 01bb6f005fcde92fa8a0567bf122d022
BLAKE2b-256 f3824f663c52a5afabb6b2f5bf3e4a1977316b8d6b5a6bf6cea51a2731661cb3

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