09.04.2025
Kick off with Wagtail Localize and level up your multilingual site
Wagtail Localize: Multilingual Django Websites
Want to build a multilingual website with Django? With Wagtail Localize, it's fast and developer-friendly. This powerful extension for the Wagtail CMS gives you full control over your translations – right inside the admin interface.
Table of Contents
What is Wagtail Localize?
Wagtail is a flexible, modern CMS for Django. If you’re building multilingual websites, Wagtail Localize makes it easy to manage content and translations – manually or automatically.
With Wagtail Localize, you can:
- Manage multilingual content directly in the Wagtail admin
- Use manual or machine translation
- Define translation workflows and optimize content per locale
- Build SEO-friendly, multilingual sites with ease
Installation & Getting Started
1. Install Wagtail Localize
Run the installation via pip:
pip install wagtail-localize
Then add the required packages to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
"wagtail_localize",
"wagtail_localize.locales", # Enables the management of multilingual content
"wagtail.contrib.modeladmin",
*INSTALLED_APPS,
]
Now run the migrations:
python manage.py migrate wagtail_localize
2. Configure Your Languages
Set up the supported languages in settings.py:
from django.utils.translation import gettext_lazy as _
LANGUAGES = [
("en", _("English")),
("de", _("Deutsch")),
("fr", _("Français")),
]
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES
Activate internationalization in Wagtail:
WAGTAIL_I18N_ENABLED = True
Managing Multilingual Pages in Wagtail
Wagtail uses Locales to organize language versions. It automatically creates separate versions for each language, all accessible via the admin UI.
To create custom pages in Wagtail, just use the regular Page model.
Example: multilingual custom page
from wagtail.models import Page
class CustomPage(Page):
pass
This page model is automatically handled by Wagtail Localize and can be added in different languages.
You’re all set to manage your first multilingual pages – but that’s just the beginning.
When to Use TranslatableMixin?
FWant to translate snippets or custom models? Then you’ll need to use TranslatableMixin.
Example: multilingual person snippet:
from wagtail.snippets.models import register_snippet
from wagtail_localize.models import TranslatableMixin
from django.db import models
from wagtail.admin.panels import FieldPanel
from django.utils.translation import gettext_lazy as _
@register_snippet
class Person(TranslatableMixin, models.Model):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)
email = models.EmailField(blank=True, null=True)
job_function = models.CharField(_("Function"), max_length=400, blank=True, null=True)
job_function_international = models.CharField(_("Function international"), max_length=400, blank=True, null=True)
image = models.ForeignKey("wagtailimages.Image", null=True, blank=True, on_delete=models.SET_NULL, related_name="+")
phone = models.CharField(_("Phone"), max_length=200, blank=True, null=True)
mobile = models.CharField(_("Mobile"), max_length=200, blank=True, null=True)
country = models.CharField(_("Country"), max_length=200, blank=True, null=True)
panels = [
FieldPanel("first_name"),
FieldPanel("last_name"),
FieldPanel("email"),
FieldPanel("job_function"),
FieldPanel("job_function_international"),
FieldPanel("image"),
FieldPanel("phone"),
FieldPanel("mobile"),
FieldPanel("country"),
]
def __str__(self):
return f"{self.first_name} {self.last_name}"
Common use cases:
- Translating team member profiles
- Multilingual product descriptions
- Locale-specific configuration settings
Best Practices with Wagtail Localize
1. Keep Your Language Versions Consistent
- Maintain the same structure across languages
- Translate SEO content like page titles and meta descriptions
2. Optimize for Multilingual SEO
- Use hreflang tags to help search engines match the right language
- Structure your URLs with language prefixes, e.g., /en/about/ instead of /about-en/
3. Don’t Forget Performance
- Enable caching to serve frequently translated content faster
Your Start with Wagtail Localize
With Wagtail Localize, going multilingual is simple. From setup to translation and SEO optimization, it’s a powerful tool for any Django-based website.
Use these best practices and start building robust, multilingual experiences today!
Frequently Asked Questions
1. What is Wagtail Localize and why should I use it?
Wagtail Localize is a powerful translation extension for Wagtail CMS. It lets you manage multilingual content directly in the admin, streamline translation workflows, and optimize pages for international SEO.
2. How do I install Wagtail Localize in my Django project?
Installation takes just a few steps:
- Install the package: pip install wagtail-localize
- Add it to your INSTALLED_APPS
- Run migrations with python manage.py migrate wagtail_localize
3. Can I use automatic translations with Wagtail Localize?
Yes! Wagtail Localize supports both manual and machine translations. You can integrate tools like DeepL or Google Translate for auto-translation.
4. How does language management work in Wagtail?
Wagtail uses a Locale system to organize content. Each language version gets its own page structure, all managed within the Wagtail admin interface.
5. Is Wagtail Localize SEO-friendly?
Absolutely. Wagtail Localize supports multilingual SEO best practices like:
tags - Clean, language-specific URLs
- Custom meta titles & descriptions per locale