Skip to content

Translation plugin for Wagtail CMS (Beta)

Notifications You must be signed in to change notification settings

dslima90/wagtail-localize

 
 

Repository files navigation

Wagtail localize

Installation and setup

Install with pip:

pip install wagtail-localize

Settings modifications

Add wagtail_localize and any optional sub modules to INSTALLED_APPS in settings/base.py:

INSTALLED_APPS = [
    ...
    "wagtail_localize",
    ...
]

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 Google Translate as a machine translator, add the following to your settings:

WAGTAILLOCALIZE_MACHINE_TRANSLATOR = {
    'CLASS': 'wagtail_localize.machine_translators.google_translate.GoogleTranslateTranslator',
}

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)),
)

About

Translation plugin for Wagtail CMS (Beta)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.8%
  • Other 1.2%