MediaWiki Content Translation β Translate Extension, Page Translation Workflow, and Language Management
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
- Create or edit a page (e.g., "Installation Guide")
- After saving, look for "Mark this page for translation" link
- 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
- Add the
<translate>tags to your page content - Click "Mark this page for translation"
- Review the translation units that Translate detected
- Uncheck any units that should not be translated
- 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:
- Edit the English page
- Click "Mark for translation" again
- Affected translation units are flagged as "outdated"
- Translators see which units need updating
- 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 unitsSpecial:Translateis 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
- What is the purpose of
<translate>tags in the Translate extension? - How does the Translate extension handle changes to source content after translation?
- What are message groups and how do aggregate groups help manage translations?
- 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
Mini Project
Goal: Build a fully multilingual documentation section.
- Install the Translate extension with 4 languages (English, Spanish, French, German)
- Create a page called "DodaBrowser Features" with 10 translation units:
- Title and 3 feature descriptions
- Each feature has a title, description, and bullet points
- Mark the page for translation
- Translate all units into Spanish
- Translate 7 of 10 units into French
- Translate all units into German
- Verify translation progress using Special:TranslationStats
- Create an aggregate group for browser documentation
- Change one English feature description and mark for translation
- Update the Spanish translation for the changed unit
- Approve all Spanish translations through the review Process
- 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