Implementing Multi-Language Support in MediaWiki Using the Translate Extension

Why go multilingual?

Imagine a small community wiki about local folklore, suddenly opened to visitors from Tokyo, Nairobi and Buenos Aires. The content is still the same, but the language barrier turns curious clicks into dead‑ends. A few weeks later the same wiki sprouts a French version, a German version, even a Swahili copy – traffic spikes, contributors multiply, and the whole ecosystem feels more alive.

That’s the promise of multi‑language support: it’s not just about translation, it’s about widening the circle of participation. In practice, MediaWiki ships with a solid core, but the heavy lifting for proper localisation lives in extensions. The Translate extension is the workhorse that turns a monolingual MediaWiki into a multi‑language hub.

Getting the Translate extension

First things first – you need the code. The extension is available via Composer, as a regular Git checkout, or even bundled in the MediaWiki Language Extension Bundle (MLEB). A quick composer require mediawiki/translate will pull in the latest stable release (as of mid‑2024, version 2025‑07‑31).

If you’re on a hosted platform like Miraheze or Wiki.gg, the admin panel often offers a “Enable extensions” toggle – just tick Translate and let the system spin up the database tables. Behind the scenes, update.php will create tables such as revtag, translate_groupstats and translate_messageindex. You’ll see those names pop up in Special:Version later.

Now, a little anecdote: when I first tried to install it on a test wiki, the update.php script complained about missing php extensions. Turns out the yaml PHP library (often called phpyaml) is optional but highly recommended. After installing php-yaml via the distro’s package manager, the upgrade ran smooth as butter.

Configuring your wiki for multiple languages

Enabling the extension is just the opening act. The real configuration lives in LocalSettings.php. Below is a minimalist snippet that gets most wikis up and running:


# Turn on page translation feature
$wgEnablePageTranslation = true;

# Languages you want to support – you can start with a few and add later
$wgTranslateSupportedLanguageCodes = [ 'en', 'es', 'fr', 'de', 'ru' ];

# Where to store custom translation groups (YAML files work best)
$wgTranslateGroupFiles = [ __DIR__ . '/translateGroups' ];

# Enable translation memory (optional, but a huge time‑saver)
$wgTranslateTranslationDefaultService = true;

Notice the $wgEnablePageTranslation flag – without it, the special page Special:Translate will still let you translate interface messages, but you won’t get the neat “Mark this page for translation” banner that appears in the edit toolbar.

A small digression: the list of languages can be pulled from the Translate language table on translatewiki.net. That site hosts the biggest crowd‑sourced translation effort for MediaWiki itself, so you’ll find the most up‑to‑date language codes there. If you’re feeling adventurous, you can even let users request new languages via the $wgTranslatePageTranslationULS variable – the Universal Language Selector will then redirect them to the appropriate translation subpage.

Translating pages and interface messages

Once the extension is live, you’ll notice a new Special:Translate entry in the toolbox. It’s a one‑stop shop for:

  • Interface messages (the strings that appear in the UI, stored under the MediaWiki namespace).
  • Content pages you’ve marked as translatable – these get a “page‑translation” tag in the wikitext, usually something like <languages /> or a TRANSLATE comment.
  • Message bundles – groups of related strings that can be exported as Gettext, JSON or YAML for offline translation.

Let’s walk through a quick example. Suppose you have a page Help:Getting started you want in Spanish. Edit the page and add the TRANSLATE magic word at the top:


{{TRANSLATE}}
= Getting started =

Welcome to our wiki! Here you’ll learn how to edit pages...

Save the page, then click the “Mark this page for translation” button that appears in the toolbar. MediaWiki will spin up a new subpage under Help:Getting started/es. That subpage contains the original wikitext wrapped in a <translate> tag, and you can start filling in the Spanish version. When you’re done, hit “Save” and the system automatically updates the language selector on the original page – visitors can now toggle between English and Spanish.

Interface messages work a bit differently. Go to Special:Translate, pick “Interface messages”, and you’ll see a list of groups like “core”, “mediawiki”, “extension‑translate”. Click a group, then a language, and the translation editor pops up. The editor shows the original string, any parameters (like $1) and a live preview. It also warns you if you accidentally drop a placeholder – a minor annoyance that saves a lot of broken UI later.

Tips and pitfalls (a few hard‑won lessons)

1. Don’t forget to run update.php after enabling new language groups. The extension adds a bunch of tables; missing a migration step often leads to cryptic “Database table not found” errors when you try to translate.

2. Watch out for “fuzzy” translations. When the source text changes, the extension marks existing translations as fuzzy. Users can see a yellow warning and decide whether to keep the old version or update it. If you have a lot of fuzzy messages, consider enabling the $wgTranslateKeepOutdatedTranslations variable – it shows the outdated translation instead of the source, giving translators context.

3. Parameters are sneaky. If a message contains $1 or {{PLURAL:$1|one|many}}, the translator must keep those placeholders intact. The editor highlights mismatched parameters, but the warning only shows up after you click “Save”. A quick glance before saving can save you from a broken interface.

4. Don’t forget the language list tag. Adding <languages /> to a page tells MediaWiki which languages are available. Without it, the language selector won’t appear, even if a translation exists. It’s easy to miss, especially when copying page templates.

5. Be mindful of bots. The $wgTranslateFuzzyBotName variable defines the system user that marks translations as fuzzy. If you have custom bots that edit pages, add them to the exclusion list ($wgTranslateAuthorExclusionList) to avoid noisy notifications.

Beyond the basics: translation memory and automation

One of the biggest time‑savers is hooking up a translation memory (TM). The Translate extension ships with a built‑in TM server (TTMServer) that stores previously entered translations and offers suggestions as you type. To enable it, set $wgTranslateTranslationDefaultService = true; (as shown earlier) and make sure the translate database tables are writable.

But the ecosystem is richer than that. You can plug in external services like Apertium, Microsoft Translator, or Yandex Translate via the $wgTranslateTranslationServices array. Here’s a tiny example that adds Apertium for Finnish‑English:


$wgTranslateTranslationServices = [
    'apertium' => [
        'url' => 'https://apertium.org/apy',
        'key' => '',
        'langpairs' => [ 'fi-en' ]
    ]
];

The extension will then display machine‑generated suggestions above the manual translation box. You can accept, tweak or reject them – it’s a collaborative dance between human translators and AI.

Another neat feature is message bundles. If you’re developing a software project that needs its strings in multiple languages (think a mobile app using Gettext), you can export a bundle directly from MediaWiki. The bundle can be handed over to developers, who can then integrate the .po files into their build pipeline. The reverse direction works too: you can import a CSV of translations back into the wiki, thanks to the “Import translations via CSV” tool under the translation admin menu.

Real‑world stories (what people are actually doing)

It’s easy to brag about features, but the proof is in the field. A few months ago, the KDE UserBase wiki (userbase.kde.org) rolled out full page translation for its documentation. They started with English, German, French and Russian, then added Japanese and Chinese after seeing a surge in traffic from East Asia. The Translate extension handled the heavy lifting, while the community used the built‑in translation memory to keep terminology consistent across pages.

Another example: the Wikimedia Foundation’s own Meta wiki uses Translate for its interface messages. The result? Contributors from over 30 language communities can edit the same pages, and the language selector is always present, even on older pages that pre‑date the extension. The team also integrated the “Translation notifications” extension (see Extension:TranslationNotifications) to ping translators when a new message appears, which cut down review time by roughly 20 %.

And let’s not forget the humble hobbyist site that uses Translate to host a multilingual recipe collection. They started with just English and Spanish, then added Catalan after a local cooking club requested it. The admin noted that the Special:Translate dashboard showed a clear “unfinished translations” bar, which motivated volunteers to contribute during weekend hack‑athons.

Wrap‑up thoughts

Implementing multi‑language support in MediaWiki doesn’t have to be a massive engineering project. With the Translate extension you get a ready‑made workflow for interface messages, page content, and even bulk exports. The key is to start small – pick a handful of languages, enable the extension, and let the community discover the translation tools.

Remember the little quirks: run update.php, keep placeholders intact, and sprinkle the <languages /> tag on translatable pages. Once the basics are solid, you can explore translation memories, external MT services, and message bundles to accelerate the process.

In the end, a multilingual wiki is more than a collection of translated pages; it’s a bridge that lets people from different corners of the world share knowledge, collaborate, and feel at home. The Translate extension is the sturdy bridge‑builder, and MediaWiki gives you the river to cross. Happy translating!

Subscribe to MediaWiki Tips and Tricks

Don’t miss out on the latest articles. Sign up now to get access to the library of members-only articles.
jamie@example.com
Subscribe