Skip to content

MediaWiki Content Translation β€” Translate Extension, Page Translation Workflow, and Language Management

DodaTech Updated 2026-06-26 9 min read

In this tutorial, you will learn about MediaWiki Content Translation. We cover key concepts, practical examples, and best practices to help you master this topic.

Content translation in MediaWiki uses the Translate extension to mark pages for translation, split content into manageable translation units, track progress per language, and maintain synchronized multilingual documentation β€” the same system Wikipedia uses to translate interface messages and Wikimedia projects use for multilingual content.

What You'll Learn

  • Installing the Translate extension
  • Marking pages for translation
  • Adding translation tags and units
  • Managing translations through Special:Translate
  • Tracking translation progress
  • Adding new languages to your wiki

Why It Matters

A multilingual wiki is essential for reaching a global audience. Without a translation system, you would need to maintain separate pages for each language, manually synchronize changes, and hope translations stay in sync. The Translate extension automates this. You write content once, mark it for translation, and translators work on individual units. When the source changes, translators see what needs updating. The result is fully synchronized multilingual content with minimal effort.

Real-World Use

A DodaTech product wiki publishes documentation in English, Spanish, French, German, and Japanese. A new feature is announced. The engineering team writes the English page. The Translate extension automatically detects 8 new translation units. Translators receive notifications. Within a week, all five languages are updated. When the English page is revised, translators see only the changed units, not the entire page.

Learning Path

flowchart LR
  A["30: Interwiki Links"] --> B["31: Wiki Farms"]
  B --> C["32: Content Translation"]
  C:::current
  D["33: Import & Export"]
  E["34: REST API"]
  F["35: Database Maintenance"]

  C --> D --> E --> F

  classDef current fill#38bdf8,color#0f172a,stroke-width:2px

Step 1: Install the Translate Extension

The Translate extension requires several dependencies.

cd /opt/lampp/htdocs/mediawiki/extensions

# Clone the extension
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Translate.git
cd Translate
git checkout REL1_42

Enable in LocalSettings.php:

wfLoadExtension( 'Translate' );

// Required: Enable page translation feature
$wgEnablePageTranslation = true;

// Optional: Enable translation notifications
$wgTranslatePageTranslationBanner = true;

Run the maintenance script:

php maintenance/update.php

Step 2: Add Languages to Your Wiki

Configure which languages your wiki supports:

// Add languages
$wgLanguageCode = 'en';  // Default language
$wgTranslateLanguages = [
    'en' => 'English',
    'es' => 'Spanish',
    'fr' => 'French',
    'de' => 'German',
    'ja' => 'Japanese',
    'zh' => 'Chinese',
];

Setting Up Language Namespaces

Each language gets its own subpage under the main page:

Documentation                        ← English (source)
Documentation/es                     ← Spanish translation
Documentation/fr                     ← French translation
Documentation/de                     ← German translation

The Translate extension creates these subpages automatically.

Step 3: Mark a Page for Translation

  1. Create or edit a page (e.g., "Installation Guide")
  2. After saving, look for "Mark this page for translation" link
  3. Click it to enter the translation marking interface

Translation Tags

Translate splits content into translation units β€” sections between <translate> tags:

<translate>
== Introduction ==
This guide covers the installation of DodaSync.

== System Requirements ==
* 1 GB RAM
* 100 MB disk space
</translate>

MediaWiki automatically assigns each unit an ID: Installation_Guide-1, Installation_Guide-2.

Using Variables

For text that should not be translated (product names, version numbers):

<translate>
Welcome to <!-- T:version-label -->version {{{version}}}<!-- T:version-end --> of DodaSync.
</translate>

Variables and tags inside <translate> blocks are preserved in translations.

Step 4: Mark the Page

  1. Add the <translate> tags to your page content
  2. Click "Mark this page for translation"
  3. Review the translation units that Translate detected
  4. Uncheck any units that should not be translated
  5. Click "Mark for translation"

The page is now in the translation queue. A notice appears on the page:

This page is ready for translation.
[Translate to English] [View translations]

Step 5: Translate Content

Special:Translate

The Special:Translate page is the main translation interface. It shows:

All untranslated pages
──────────────────────────────────
Installation Guide β†’ en β†’ es (0/8)
Installation Guide β†’ en β†’ fr (2/8)
Installation Guide β†’ en β†’ de (8/8) βœ“

Translation Editor

Clicking a language opens the translation editor:

English (source):
This guide covers the installation of DodaSync.

Spanish (translation):
[___________________________]

[Save translation] [Skip] [Show next]

The editor shows:

  • Source text: The original text (read-only)
  • Translation area: Text box for the translated version
  • Translation memory: Suggestions from previously translated content
  • Machine translation: Optional integration with external services
  • Character counter: Shows remaining length limits

Translation States

Each unit has a state:

  • Untranslated: Not yet translated
  • Translated: Translation saved but not reviewed
  • Reviewed: Translation approved by a reviewer
  • Outdated: Source changed, translation needs update

Step 6: Translation Management

Special:TranslationStats

Shows statistics by language:

Language  | Total units | Translated | Percentage
──────────|─────────────|────────────|───────────
English   | 48          | 48         | 100%
Spanish   | 48          | 42         | 87.5%
French    | 48          | 38         | 79.2%
German    | 48          | 48         | 100%
Japanese  | 48          | 12         | 25%

Translation Review

Users with the translate-review permission can review translations:

Language: Spanish β†’ Installation Guide

Unit 1: "This guide covers the installation of DodaSync."
Translation: "Esta guΓ­a cubre la instalaciΓ³n de DodaSync."

β˜‘ Approve   ☐ Needs editing   [Save]

Notification of Outdated Translations

When the source page changes:

  1. Edit the English page
  2. Click "Mark for translation" again
  3. Affected translation units are flagged as "outdated"
  4. Translators see which units need updating
  5. Floating notification banners appear on translated pages

Step 7: Message Groups

Translate organizes translations into message groups.

Page-Based Groups

Each page marked for translation becomes a message group:

Message groups:
  /Installation_Guide (8 units, 3 languages)
  /Configuration_Guide (12 units, 2 languages)
  /FAQ (15 units, 1 language)

Aggregate Groups

Group multiple pages together for easier management:

Aggregate group: DodaSync Documentation
  /Installation_Guide
  /Configuration_Guide
  /FAQ
  /Troubleshooting

Translators can work on all DodaSync pages from one interface.

Step 8: Machine Translation Integration

Translate can integrate with external machine translation services:

// Enable Google Translate integration
$wgTranslateTranslationServices['Google'] = [
    'url' => 'https://translation.googleapis.com/language/translate/v2',
    'key' => 'your-api-key',
    'timeout' => 3,
];

Machine translations appear as suggestions that translators can accept, reject, or modify.

What You Learned

  • The Translate extension enables page-level translation workflows
  • <translate> tags mark content as translatable units
  • Special:Translate is the main translation interface
  • Translation states track progress and outdated content
  • Message groups organize translatable pages
  • Translation review requires specific permissions
  • Machine translation provides initial suggestions
  • Outdated translations are flagged when source content changes

In the next lesson, you'll learn about importing and exporting content.

Common Mistakes

Mistake Why It Happens How to Fix
"Mark this page for translation" link not appearing Page not saved after adding <translate> tags Save the page with <translate> tags first, then look for the "Mark for translation" link. The link only appears after the page exists with translation markup.
Translation units not detected Content outside <translate> tags Ensure all translatable content is inside <translate>...</translate> tags. Content outside these tags is not split into units.
Translation shows raw tags Variables or special syntax not preserved Use {{{var}}} syntax for variables that should stay unchanged. The Translate extension preserves variable syntax in translations.
Translated page shows empty sections Source content changed after translation Review the "outdated" translations and update them. Changing source content without marking for translation can break the translation structure.
Cannot review translations Missing permissions Grant the translate-review right to trusted users: $wgGroupPermissions['editor']['translate-review'] = true.

Practice Questions

  1. What is the purpose of <translate> tags in the Translate extension?
  2. How does the Translate extension handle changes to source content after translation?
  3. What are message groups and how do aggregate groups help manage translations?
  4. Challenge: Build a multilingual documentation system. Install the Translate extension and configure 3 languages (English, Spanish, French). Create a page called "Getting Started" with 6 translation units (title, intro, 3 steps, conclusion). Mark the page for translation. Translate the page into Spanish (all units) and French (4 of 6 units). Verify that the Spanish page shows 100% translated and French shows 66%. Change the English source text in one unit and mark for translation again. Verify the affected translations are flagged as outdated. Update the Spanish translation. Add a reviewer account and approve all Spanish translations. Check the translation statistics page.

FAQ

Can I translate only parts of a page?

Yes. Content outside tags is not translated. Use this for non-translatable content like code blocks, version numbers, or navigation elements. Only the tagged portions are sent to translators.

How do I add a new language after pages are already translated?

Add the language code to $wgTranslateLanguages in LocalSettings.php. Existing pages will show the new language as 0% translated. Translators can start translating from scratch.

Does the Translate extension work with all namespaces?

Yes, but it is primarily designed for the main (content) namespace. You can enable it for other namespaces via the $wgTranslateNamespaces configuration variable.

Can I export translations for external use?

Yes. Translate supports various export formats including Gettext PO files. Use Special:ExportTranslations to download translations in multiple formats for use in other tools.

How do I handle images with text in different languages?

Use language-neutral images (no embedded text) where possible. For images with text, create language-specific versions like screenshot-en.png and screenshot-es.png and use the Translate extension's image support to link the correct version.

Mini Project

Goal: Build a fully multilingual documentation section.

  1. Install the Translate extension with 4 languages (English, Spanish, French, German)
  2. Create a page called "DodaBrowser Features" with 10 translation units:
    • Title and 3 feature descriptions
    • Each feature has a title, description, and bullet points
  3. Mark the page for translation
  4. Translate all units into Spanish
  5. Translate 7 of 10 units into French
  6. Translate all units into German
  7. Verify translation progress using Special:TranslationStats
  8. Create an aggregate group for browser documentation
  9. Change one English feature description and mark for translation
  10. Update the Spanish translation for the changed unit
  11. Approve all Spanish translations through the review Process
  12. Verify the translated pages display correctly in each language

What's Next

Content translation opens your wiki to global audiences. Now let's learn how to move content between wikis.

Continue to Lesson 33: Import & Export β€” learn about XML export and import, page Migration, and interwiki import.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro