Introduction

MediaWiki's translation extension allows users to add translations to pages. This page will cover step by step, how to make a page translatable and how to add translations to the existing page.

How to make a page translatable

By default, newly created pages are not translatable. For these pages to accept translations, we need to add specials HTML tags inside the page :

  • <languages/> : This tag is placed on the first line of the page and tells MediaWiki that this page can be translated.
  • <translation> : This tag tells what part of the text can be translated.
  • <translation/> : Closes the previously opened translation tag.
  • <!--T:N--> : This tag is used to segment the text. Segmenting the text is very useful to translate very large pages.

Example

The following example represents a very simple page :

<div id=example_page><languages/>

<translation>

<!--T:1-->

First paragraph.

<!--T:2-->

Second paragraph.

<!--T:3-->

Third paragraph.

</translation>


Another paragraph.

</div>

<style>

#example_page {

margin_right=20px;

background_color=red;

}

</style>


In the following text, paragraphs are segmented in three parts. Each segment can be translated because they are inside a <translation> tag. However, the last paragrah cannot be translated.