Integrate django-modeltranslation with lokalise.co
Project description
Django modeltranslation-lokalise
Integrate django-modeltranslation with lokalise.co. It will let your project upload translatable fields of your model into lokalise.io using it's API and also update your local translations when someone updates them on lokalise.
Installing
pip install modeltranslation-lokalise
modeltranslation_lokalise
depends on Django's contribtypes application,
so make sure you include it in your INSTALLED_APPS
setting before modeltranslation_lokalise
:
INSTALLED_APPS = [
'...',
'django.contrib.contenttypes',
'...',
'modeltranslation_lokalise',
'...',
]
You need to provide your lokalise proyect id and your api key in order to let modeltranslation_lokalise
properly update
your translations.
LOKALISE_API_KEY = ''
LOKALISE_PROJECT_ID = ''
If you want to get your models updated automatically when someone updates them on lokalise, enable it by adding the view to
your urls.py
conf. Note that currently only translation.updated
is supported:
from modeltranslation_lokalise import TranslationWebhookView
urlpatterns = [
...
path('api/translations/', TranslationWebhookView.as_view(), name='translation_webhook'),
...
]
You also need to make migrations in order to create the necessary tables on your database to handle the translations:
python manage.py makemigrations
python manage.py migrate
License
This project is licensed under the MIT License - see the LICENSE file for details
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
Hashes for modeltranslation-lokalise-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5f30f6fb2f6f44bd76f4a2e54e34b1363da34254d1da137ea25d817f8610de0 |
|
MD5 | df97031951c6bd569b8e270c643a41d2 |
|
BLAKE2b-256 | 92d971e6fb2f8b39ad9c049b30e0a2cad826c3ce590351f32f41cd746c94afd6 |