Jump to content

Translate extension

From Wikimedia Belgium

The Translate extension allows for easy translation of Wikimedia pages on a multilingual platform. The extension is installed on all major platforms. Wikipedia is only serving one single language per platform; it has its own dedicated translation system.

It allows MediaWiki platforms to really become multi-language. It is crucial that the master (source) page is well structured with the necessary translation tags, so that the translation process is straightforward for the translators.

Translation sections should be kept short, and should not contain specific wiki syntax.

This tool is not to be confused with the dedicated Wikipedia article translation tool that is used to translate Wikipedia pages.

Advantages

[edit]
  • Easy to use for translators, a bit more difficult for the base page editor, and for the Translation administrators.
  • Keep page sections aligned amonst languages.
  • Well integrated in the MediaWiki environment, e.g. using Special:MyLanguage/ link prefix a language code suffix is automatically added for the readers' language.
  • For the reader it is completely transparant.
  • Any language can be the base language, but English is the standard (most translators understand English).
  • Translation to any language can be incremental; untranslated sections show the original text (typically English).
  • Work is distributed amongst volunteers. Nobody knows all languages.
  • The history of the translated texts are maintained.
  • Translated sections can be reused on other pages (so it is advantageous to keep translation sections short).

Procedure

[edit]
  1. Write your text. Add a single empty line before a paragraph, a list, a header, or any other sections in your document. This makes it easier for the parser to automatically create translation units. The default language is English, but it can be any other language.
  2. Start your document with <languages/> on the first line to automatically build a language list
  3. Add <translate> and </translate> tags where you want to translate text
  4. Mark the page for translation
    • Don't do this until the basic document is completely ready
    • Add all necessary translation markup tags
  5. Translate the page into any available language
  6. Maintain the updates
  7. When the source text changes, the Translation administrator has to mark the page again for translation

Restrictions

[edit]
  • Only the base text (source page) can be edited.
  • Translated pages can only be maintained by the tool. They can't be edited in the normal way.
  • There is a suffix version of the base text without translation units, that can be used to copy the wiki text to other platforms.
  • You need to be member of the Translation administrator group in order to be able to mark a page for translation.
  • Any user can translate the article to any language once it is marked for translation by the administrator.
  • There is an internal version control, so anyone can verify if a translation is out-of-date.
  • Never remove the space after the special translation unit comments.
  • Do not manually insert nor remove the translation unit comments.
    • Make sure translation units are separated from each other (one blank line between the header and the next paragraph).
    • When copying text from other translated pages, only paste the text, not the "foreign" translation unit comments. When necessary copy wiki code from the /en version of the page (translation units being removed).
    • When you want to remove all text of a translation unit, also remove the structured comment, to avoid conflicts amongst translation units.

Specific rules

[edit]

Translators should only see short textual paragraphs and sentences to translate. Not complicated Wiki code.

For simple documents, i.e. only containing headings and paragraphs, only one single <translate> tag (after the header) and </translate> tag (before the trailer) is sufficient.

Insert one blank line before section headers.

Make sure you start every paragraph with a blank line (even the first paragraph after a head). Doing so the software can correctly parse heads and paragraphs. Typically you should not mark the header and the footer of the article: place <translate> after the header </translate> before the footer.

Lists should have one <translate> </translate> pair for each line after the * or the #

URL labels (both internal and external) need to be embedded in <translate> </translate> pairs.

You need to add one extra </translate> and  <translate> tags before and after a list or a (group of) URLs.

Use the {{lwp}} template to embed a Wikipedia page.

Categories need a {{#translation:}} suffix.

{{PAGELANGUAGE}} can be used everywhere... it translates to the "local" ISO language code.

Requirements

[edit]
  1. The extension needs to be installed by the site administrator.
  2. The page needs to be marked for translation by the translation administrator.
  3. You need volunteers capable of translating from the source language to the target language.
  4. You better choose the source language to be the best known language

Components

[edit]
Component Description Remarks
Set source page language Set the page language
Activate a source page for translation Add <languages/> and <translate> tags Editing subpages is disabled
Deactivate a page for translation Deactivate a page and remove the translation tags Enable subpage editing
Import a subpage Initially align translated page sections Do it once only
List translated pages Show list of translated pages Manage the pages
Translate Translate a page The actual translation

Known problems

[edit]

Out-of-date translations

[edit]

The original text has been modified, and the page is not yet marked again for translation, or some languages still need to be updated.

Multiple verbatim translate tags

[edit]

When you see everywhere verbatim <translate> and </translate> tags, the obvious problem is a missing empty line between a header and a paragraph. This leads to two "concatenated" and conflicting translation units. Remember every paragraph has to start with an empty line for the translation engine to work properly.

Wrong source language

[edit]

Any language can be source language. Default is the wiki default language. English is most used, since it is internationally best known.

  • Use Special:PageLanguage to change the source language when it was wrongly set during the first mark for translation.

Bot adds untranslated English page

[edit]

Add the list of languages that are needed.

See also

[edit]