Translation
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 :
<languages/>
<translation>
<!--T:1-->
First paragraph.
<!--T:2-->
Second paragraph.
<!--T:3-->
Third paragraph.
</translation>
<!--T:4-->
Another paragraph.
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.
When changes are saved, it will be possible to make the page translatable by clicking on the link "Make this page translatable" at the bottom of the page.
Add translations to a page
As soon as the page is marked as translatable, the following link shown on the picture appear on top of the page. To add a translation, click on "Translate this page".
This link leads us to the translation page, where we can select in which language and which part of the text we want to translate.
At first, we need to select in which language we want to translate the page, the following figure shows the selector present on top of the page :
Then we choose which part of the text needs translation. Those part are distinguished by the <!--T:N--> tags.
We just have to click on one part, write our translation in the desired language, and save.
In this way, other editors can easily track, add and change translations.