Configuration
Enabling i18n
Multilingual support is enabled in the settings throughWAGTAIL_I18N_ENABLED:
settings/base.py
Supported Languages
The demo supports three languages configured viaWAGTAIL_CONTENT_LANGUAGES:
settings/base.py
The
WAGTAIL_CONTENT_LANGUAGES setting defines which languages are available for content creation in the Wagtail admin interface.Translation Features
Enable Simple Translation
The demo uses
wagtail.contrib.simple_translation for streamlined translation workflows:settings/base.py
How It Works
Page Translation
All Wagtail pages automatically support translation whenWAGTAIL_I18N_ENABLED is set to True. Editors can:
- Create translated versions of pages through the admin interface
- Switch between language versions
- Manage locale-specific content independently
Snippet Translation
Snippets that inherit fromTranslatableMixin can be translated:
Admin Interface
With i18n enabled, the Wagtail admin provides:- Language switcher in the page editor
- Locale management interface at
/admin/locales/ - Translation workflows using the Simple Translation contrib module
- Locale-specific page trees for organizing content
Advanced: Locale-Specific Content
Advanced: Locale-Specific Content
When a page is translated, Wagtail creates a new page instance for each locale. This means:
- Each language version can have different content, including different StreamField blocks
- Page slugs can be customized per locale
- Publication status is managed independently per locale
- Translations are linked together through Wagtail’s locale system
Best Practices
Use TranslatableMixin
Apply
TranslatableMixin to snippets and models that need translation support.Test All Locales
Ensure your content and templates work correctly in all configured languages, especially right-to-left languages like Arabic.
Locale-Specific URLs
Pages automatically get locale-specific URLs (e.g.,
/en/about/, /de/about/).Simple Translation
Use the Simple Translation contrib module for streamlined translation workflows in the admin.
Related Settings
settings/base.py
Django’s
USE_I18N setting must be True for Wagtail’s i18n features to work properly.
