User:BPositive/Page preparation

From MediaWiki.org
Jump to navigation Jump to search
PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
PD

MediaWiki's Translate extension provides a user friendly interface for translators to translate wiki pages and software in their own language.

The page to be translated needs to be converted into a format that can be recognized by the Translate extension. This is known as preparing the page for translation. Once the page is prepared, it can be marked for translation and Translate would split it into units which would then appear at Special:Translate.

The process of page preparation involves adding <translate> tags around translatable content. It also includes handling categories, templates, images, etc as per the markup defined. This is a manual task, which is automated by Special:PagePreparation.

How to use?[edit]

  1. Go to Special:PagePreparation
  2. Enter the title of the page you want to prepare
  3. Click on the 'Prepare' button
  4. A diff between the source text and the prepared text would be shown. So, you can have a look at the changes made by the tool.
    1. If you are happy with the changes, click on the 'Save' button. This will save a new revision of the page under question with the prepared text. Once the revision is saved, you will be given an 'edit' link which will take you to your default editing window for the page under question. You can then make changes which were left out by the tool and save again.

Features provided by tool[edit]

Feature Source text Prepared text
Add <languages/> tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus, euismod fermentum risus auctor a. Praesent non mi massa. Proin consequat enim ut imperdiet lobortis.
{{Languages}}

<languages/>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus, euismod fermentum risus auctor a. Praesent non mi massa. Proin consequat enim ut imperdiet lobortis.

Add <translate> and <translate/&gt tags at start and end of page

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.

<translate>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
<translate/>

Add new lines before and after headers, if not present

Fusce consectetur odio vitae felis placerat, quis egestas tortor tincidunt.
== Header1 ==
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.

Fusce consectetur odio vitae felis placerat, quis egestas tortor tincidunt.

== Header1 ==

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.

Add 'Special:MyLanguage/' suffix for internal links in valid namespaces

Fusce consectetur odio [[Communication]] vitae felis placerat, quis egestas tortor [[:w:IRC]] tincidunt.

Fusce consectetur odio [[Special:MyLanguage/Communication|Communication]] vitae felis placerat, quis egestas tortor [[:w:IRC]] tincidunt.

Add language-independent anchor for links to section on same page.

== Foo Boo ==
Fusce consectetur odio [[#Foo Boo]] vitae felis placerat, quis egestas tortor [[:w:IRC]] tincidunt.

<span id="foo-boo"></span>
== Foo Boo ==
Fusce consectetur odio [[#foo-boo]] vitae felis placerat, quis egestas tortor [[:w:IRC]] tincidunt.

Exclude templates out of translate

{{Extension}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.

<translate/>
{{Extension}}
<translate>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.

Handle files with captions

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
[[File:Sunflower.png|Sunflower]]
Praesent feugiat tellus purus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
<translate/>
[[File:Sunflower.png|<translate>Sunflower<translate/>]]
<translate>
Praesent feugiat tellus purus.

Handle files without captions

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
[[File:Sunflower.png]]
Praesent feugiat tellus purus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
<translate/>
[[File:Sunflower.png]]
<translate>
Praesent feugiat tellus purus. aaaa

Keep categories as part of page template and tag them with {{#translation:}}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
[[Category:Foo|Foo]]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat tellus purus.
<translate/>
[[Category:Foo<nowiki>{{#translation:}}|Foo]]</nowiki>
<translate>