Giter Club home page Giter Club logo

riccardofasan / django-polyglot Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 69 KB

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.

Home Page: https://pypi.org/project/django-polyglot-translator/

License: MIT License

Python 100.00%
polyglot django django-application django-rest-framework django-commands deepl deepl-api i18n

django-polyglot's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.