DEV Community

Cover image for 5 Pain Points Wagtail Users Face with Multilingual Sites
Sushanth Purushothama
Sushanth Purushothama

Posted on

5 Pain Points Wagtail Users Face with Multilingual Sites

Wagtail CMS has solid building blocks for multilingual websites. It has a Locale model, TranslatableMixin, and i18n_patterns for URL routing. The wagtail-localize package adds translation workflows. It also supports machine translation.

When I read Discussion #13693, I noticed clear patterns. Maintainers and users shared their real-world experiences with i18n. Here are the five biggest pain points.

1. Links That Switch Your Language

When you call .localized on a page, it should return the translated version. But if no translation exists, it returns the source-language page instead of None. This causes menus and links to switch the user into a different language.

Many users reported this problem. One developer wrote custom _or_none methods to work around it. This should be built into Wagtail's core.

2. Sitemaps That Forget Other Languages

Wagtail's sitemap generator only lists pages in the default locale. It does not add xhtml:link alternate entries or x-default values. This hurts SEO. Search engines can't find the translated pages.

3. Search That Only Works in One Language

Wagtail's search backend does not support many locales. You cannot configure different NLP dictionaries for different languages. The only choice is to turn off language-specific processing. This leads to poor search results for everyone.

4. Page Tree Bugs in Wagtail-Localize

I experienced this myself. The "Include subtree" translation feature makes child pages. However, it does not update the parent's numchild metadata. This makes translated pages invisible in the admin. I reported it as issue #773 and fixed it with Page.fix_tree().

5. No Way to Tell Source from Translation

Wagtail's TranslatableMixin doesn't show if a page is a source or a translation. The has_translation attribute returns True even on translated pages, which is confusing. Developers need a clear way to check if a page is the original or a translated copy.

Wagtail home page with language switcher

What This Means

These are not edge cases. They affect every multilingual Wagtail site. The good news is the community has clearly identified these problems. Several of them have simple solutions.

I am proposing to work on fixes for items 1, 2, and 4 as part of my Google Summer of Code project. You can see my demo site at sushanthaaa.pythonanywhere.com and the source code on GitHub.


Read my other post: How I Found a Hidden Bug in Wagtail-Localize

Top comments (0)