Translation plugin for Wagtail CMS
Project description
Wagtail localize
Supported versions:
Python: 3.7 and 3.8 Django: 2.2, 3.0 and 3.1 Wagtail: 2.11
Installation and setup
Install with pip:
pip install wagtail-localize
Settings modifications
Add wagtail_localize
and wagtail_localize.locales
to INSTALLED_APPS
in settings/base.py
:
INSTALLED_APPS = [ ... "wagtail_localize", "wagtail_localize.locales", # Note: This replaces "wagtail.locales" ... ]
Add the following to MIDDLEWARE
:
"django.middleware.locale.LocaleMiddleware",
Ensure your settings file has:
LANGUAGE_CODE = "en-gb" # Or your preferred default language USE_I18N = True
Add to following to your settings specifying any languages you would like to translate:
LANGUAGES = [ ("en", "English"), ("fr", "French"), ]
To enable DeepL as a machine translator, add the following to your settings:
WAGTAILLOCALIZE_MACHINE_TRANSLATOR = { 'CLASS': 'wagtail_localize.machine_translators.deepl.DeepLTranslator', 'OPTIONS': { 'AUTH_KEY': '<Your DeepL key here>', } }
URL configuration
The following additions need to be made to ./yoursite/urls.py
from django.conf.urls.i18n import i18n_patterns ... urlpatterns += i18n_patterns( url(r"^search/$", search_views.search, name="search"), url(r"", include(wagtail_urls)), )
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size wagtail_localize-0.9.4-py3-none-any.whl (248.8 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size wagtail-localize-0.9.4.tar.gz (162.0 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for wagtail_localize-0.9.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c62d32c3084e0e8078636f9a9d2f934ac63570617e21b357ac778452edf81348 |
|
MD5 | 28ff35cc789225c14f9fbc4140d572b4 |
|
BLAKE2-256 | 001504bed8c4c293f82c7091d653f2e1f1fc90a0c9db07bf4d714f2a9e7dcf24 |