Open main menu

Wikimedia Commons is a multilingual project that aims to be accessible to people no matter which languages they prefer. This page describes general translation concepts and ways of linking between pages, then gives advice on how to prepare and translate project pages (policy, guidelines, help etc.) using the Translate Extension.

See Commons:Language policy for an outline of Wikimedia's general policy on languages, and Commons:Localization for more information on translating content pages such as files, galleries and categories.

Content, discussion and project pagesEdit

The approach to supporting multiple languages depends on the type of page.

Content pages are files, categories and galleries, and may have descriptions in any language. File names can be in any language, while gallery names should be in the language most associated with the subject and category names should be in English. Ideally the content pages have descriptions in the languages of the associated country and in English, but this is not required.

Content pages use the user's preferred language, {{int:lang}}, to select the language in which text is displayed. They display forms, text and links in the user's preferred language if available, but display a mix of languages when some text has been translated into the user's language and other text has not. Commons:Localization:Content internationalization methods describes ways to render text in different languages on content pages.

Discussion pages include all talk pages as well as central discussion pages such as Commons:Village pump, Commons:Administrators' noticeboard, Commons:Translators' noticeboard, and sub-pages of Commons:Deletion requests. Discussions may be started in any language. For example, in June 2019 Template talk:PD-Russia had discussions in English and Russian.

Project pages explain the scope of Commons, what content is appropriate and what content is not, how uploading works and what rules are to be observed. Project pages include policies, guidelines and other pages in the Commons and Help namespaces. The default language is English. Translations should reflect what is said on the English parent page. Text on project pages typically uses {{PAGELANGUAGE}} for internationalization. As far as possible, all text on an English version or a translation of a project page should be in the page language.

The advice that follows is mainly concerned with project pages.

LinkingEdit

Links to other pagesEdit

The {{Localized link}} template should generally be used for page links in content pages, discussion pages and project pages that do not use the Translate Extension. {{Localized link}} renders a link to a target page version in the user's preferred language if available, or failing that to a version in English.

A page link from a project page that uses the Translate extension should lead to a page in the current page language if available, in the user's preferred language if not, or finally to the English version. A reader may prefer to see information in their own language, but if that is not available will choose another language they understand. If a user who prefers Occitan has chosen a French version and clicks on a link to another project page, they should be taken to a French version of the target page if available. The system should not try to link to a version in Occitan, fail, and instead link to the English version.

{{Pg}} should generally be used for links between translated project pages, including links between English language versions. {{pg|page name}} does exactly the same as [[page name]] in the English version of a page. However, often the translated versions of the page will have gaps, where text from the English version "shows through". In the partial translations {{Pg}} will try to link to target pages in the language of the partial translation. Also, translators can simply copy links like {{pg|page name}} from the English version without worrying about what they point to.

On a French-language page, [[Commons:Administrators/fr| Commons:Administrateurs]] is the same as {{pg|Commons:Administrators}}, since the target page exists. But if {{Pg}} is used on a French page to link to a target page that has not yet been translated into French, the link will point to the user's preferred language version or the English version, then point to the French translation as soon as it comes available.

Section links and anchorsEdit

Section names are likely to be different in each translation, and may be changed at any time, which will break a link like [[page name#section name]]. If you need to link to a section in a target page, place an {{Anchor}} just before the section header, and exclude it from translation. A translator is unlikely try to translate an anchor that is capitalized and abbreviated. E.g.

</translate>{{anchor|OTHERUSE}}<translate>

===Other types of usage===

You can link to this with code like:

{{pg|pagename#OTHERUSE|displayname}} or
{{Localized link|pagename#OTHERUSE|displayname}}

Note that when no displayname is given, {{Localized link}} will show the translated page name in the user's preferred language if available, but not when a #section or #anchor qualifier is added. So if the user's preferred language is French,

*{{localized link|Commons:Copyright rules by territory/Canada}}
*{{localized link|Commons:Copyright rules by territory/Canada#DEMIN}}

will render

In the second case, the link leads to the right section in the French version, but the displayed name is in English.

With {{Pg}} on a French language page,

*{{pg|Commons:Copyright rules by territory/Canada}}
*{{pg|Commons:Copyright rules by territory/Canada#DEMIN}}

will render

DisplaynameEdit

Both {{Pg}} and {{Localized link}} let you provide a displayname other than the target page name. This may confuse the reader. They click on a link like "good practice" and are taken to a page or section that does not contain that phrase. Also, if the page is in French and the displayname is in French, the reader will naturally expect the link to take them to a French language page, and may be disconcerted when it does not. It may therefore be better to let {{Pg}} and {{Localized link}} display the actual target page name, even when that is in a different language from the source page, so the reader is prepared to switch language.

However, when a link contains an anchor name, e.g. Commons:Project page translation#DISPNAME, the anchorname may be confusing, particularly when it leads to a section with a long title. As noted above, {{Localized link}} may give an English target page name when an anchor is present, but lead to a non-English page. When linking to anchors in translated project pages it is probably best to be optimistic and give a translated displayname, as with:

*{{localized link|Commons:Copyright rules by territory/Canada#DEMIN|COM:Droit d'auteur par territoire/Canada : ''De minimis''}}
*{{pg|Commons:Copyright rules by territory/Canada#DEMIN|COM:Droit d'auteur par territoire/Canada : ''De minimis''}}

This would render

ShortcutsEdit

In discussion pages such as deletion debates, shortcuts provide a convenient way of referring to pages with long titles. COM:FOP Austria is much easier to remember and easier to type than Commons:Copyright rules by territory/Austria#Freedom of panorama. However, by convention shortcuts point to the English version of a page or page section. They should therefore not be used for links between project pages. Do not use:

See [[COM:FOP Austria]]

Instead use

See {{pg|Commons:Copyright rules by territory/Austria#FOP|COM:FOP Austria}}

which will render

See COM:FOP Austria

The {{Pg}} link will try to point to a target in the page language rather than always pointing to the English version. Note that in the example you must make sure there is an anchor named "FOP" just before the "Freedom of Panorama" section in COM:CRT/Austria.

Links to WikipediaEdit

A link to a Wikipedia article should lead to an article in the current page language if available. There are two ways to do this: direct links and Wikidata links. Links to sections or anchors within Wikipedia articles often give poor results, since Wikipedia articles in different languages are developed independently, and there is no guarantee that they will have equivalent sections. Links to pages that may redirect to sections should be more stable.

Direct Wikipedia linksEdit

Direct links use standard wiki markup like:

[[w:en:Public domain]]

Usually, but not always, the English version of the page points to articles in the English Wikipedia. The translator can check to see if there if an equivalent article in their language, and if so replace the English link by a link to this article, e.g. in a French language version of a page:

[[w:fr:Domaine public (propriété intellectuelle)]]

If there is no article in their language, the translator can copy the link to the English article or replace it by a link to an equivalent article in another Wikipedia, perhaps with a warning. Thus an Uzbek version may point to the Russian Wikipedia for a "public domain" definition, since Russian is the most common second language for readers of the Uzbek version.

[[w:ru:Общественное достояние|ommaviy mulk]] [Rus tili]

renders

ommaviy mulk [Rus tili]

The text in parentheses, [Rus tili], warns that the link leads to a Russian language page, so the reader will not be surprised when they click the link.

The direct link approach is efficient and familiar. The drawbacks are that the translator must search for an equivalent article in the page language, and if there is none at time of translation must give no link or a link to another Wikipedia. The link will not be updated when an article is created in the page language. The Wikidata links approach avoids the first problem, and avoids the second when the default English is accepted as the fallback language.

Wikidata linksEdit

The Wikidata link approach uses templates that link to Wikipedia articles in the page language if available, or in English if not, like dynamic redirect pages. The translator does not have to check the link, but can just translate the display name. The template name has a "Wp-" prefix followed by the English name of the target article. It retrieves the link to the article and a translated label from Wikidata. Syntax for using a Wikidata template is, e.g.:

{{wp-Article name|displayname|notfound|lang=language}}

All parameters are optional. The translator must decide on a case-by-case basis whether to add a display name in the version language. It allows a more natural sentence structure, but may obscure the fact that the target page is not yet available in the local language. However, the Wikidata label may have been translated even though there is no Wikipedia page in that language. For example, as of June 2019,

{{wp-Principle of least astonishment}}

rendered 最小惊讶原则 on a Chinese-language page, but linked to w:en:Principle of least astonishment.

When a displayname is provided, it may be followed by text to be given if the article is not found in the target language, which could be useful in a "See also" entry. Thus in a Volapük version of a page,

{{wp-Public domain|Notik räyun|Linglänapük}}

renders Notik räyun [Linglänapük] linking to the English version when the Volapük version of the article is not found. Once the Volapük article has been written, the same code will render Notik räyun with a link to the Volapük article.

Language code defaults to the page language, but a different language code may be given to force a link to another wikipedia. Thus:

{{wp-Public domain|Ommaviy mulk|lang=ru}} [Rus tili]

renders:

Ommaviy mulk [Rus tili]

The drawback is that this will not switch automatically to a link to an article in the page language when it is created.

Category:Wikipedia link templates using page language lists all Wikidata templates. To make a new Wikidata template, just clone {{Wp-public domain}} to [[Template:Wp-yourarticle]] and change the Wikidata |qid= value. The documentation will be generated automatically. To find the qid, go to the Wikipedia page, find the languages menu bar to the left, click on "  Edit links" to go to the Wikidata entry, then copy the qid from the title. With Wikipedia:Teahouse (Q11059110) the qid is Q11059110.

Wikipedia anchorsEdit

Avoid explicit links to sections or anchors in Wikipedia articles, whether using the direct link or Wikidata link approach. Section names are different for each language, change unpredictably and may not be present in all versions of an article. Thus as of June 2019 the French w:fr:Œuvre dérivée had just three sections other than backmatter, while the English w:en:Derivative work had thirteen. However, you may choose to indicate where to look in the article as, for example:

Voir aussi [[w:fr:Œuvre dérivée]] : ''Notion juridique''
See also {{Wp-Derivative work|Derivative work|in English}}: ''Originality requirement''

A redirect page that points to a section in an article is more likely to be updated if the section name changes or the section is split out as a separate article. A link to a redirect page like this is preferable to an explicit link to a section or anchor. Equivalent redirects can be associated in Wikidata, which can also handle the situation where topics are covered by separate articles in one Wikipedia but by article sections in another Wikipedia.

Wikidata qid Wikipedia A Wikipedia B
Q1234567890 Article D Article Д (including sections 1, 2 and 3)
Q1234567891 Article D1 Article Д1: #Redirect to Article Д, section 1
Q1234567892 Article D2 Article Д2: #Redirect to Article Д, section 2
Q1234567893 Article D3 Article Д3: #Redirect to Article Д, section 3

Technical note: According to Wikidata:Notability as of June 2019 the community had chosen to allow redirects but the necessary changes had yet to be deployed on Wikidata. There is a workaround. To add a Wikidata link to a redirect

  • First, disable the redirect, e.g. remove the leading "#" character
  • Then create or connect to the Wikidata item. You can click on "  Add links" in the languages box to the left of the redirect page and connect to the corresponding title in another wiki. Alternatively, you can create a new Wikidata item for the redirect by following the instructions at Wikidata:Help:Items#Creating a new item.
  • After this, restore the leading "#" character to the redirect.

For an example see Wikidata:Q17354234 (Wrapped Reichstag), which points to an article in the German Wikipedia and to redirects to article sections in the English and Spanish Wikipedias.

Translate extensionEdit

The Translate extension, documented at mw:Help:Extension:Translate, is the preferred way to maintain translated versions of project pages in the Commons or Help namespace, since it makes it much easier to keep the translations in sync. All project pages and templates for project pages that were translated using older methods should be migrated to the extension using its migration tool. See Page migration (below).

With the extension, the English-language version has a <languages/> tag at the top of the page, which renders a navigation bar that automatically lists all the translations:


Other languages:

The English text is marked up with <translate> and </translate> tags, which delimit "translation units". Text outside the tags is carried forward into all the translated versions, while text within the tags is replaced by translations where available. If the untagged text is changed (and approved, see below), all the translated versions reflect the change.

Before translation can begin, or after the page has been changed, a translation administrator reviews the markup and approves the page version for translation. A translator (any editor) may then click on the "Translate this page" link at the top of the page, select a language, and work through the translation units adding versions in the target language.

If the translator skips a unit, the English language version of the unit "shows through" when a reader views the translated page. When the English version of a unit has been changed since it was last translated, it is highlighted in the same way as this sentence when the translated version is viewed. A translator may work through the outdated or missing translation units.

Tips and techniquesEdit

Page layout and formatEdit

Project pages should generally have much the same look and feel as Wikipedia pages. A lead section says what the page is about, and gives a quick overview. This is followed by a table of contents, sections and backmatter like "See also", "References" and categories. An infobox may appear in the top right of the page, or the top left of the page for right-to-left languages like Arabic. See Script direction (below) for more on this. A navbox may be shown at the foot of the page.

Images should generally be defined as thumbnails and accept the defaults: [[File:Imagename|thumb|Caption text]]. Again, See Script direction (below). Paragraphs should not be too short or too long. A paragraph that fits on one line on a typical laptop is acceptable, but there should not be many of them. The same applies to paragraphs over five lines on a typical laptop: break them up. The page should use bolding, italics, bold italics, underscore etc. no more than mainstream newspapers or books. That is, hardly ever.

When these simple rules are followed, readers have a more consistent experience as they browse through the project pages. The translator also has an easier job, since the text is less cluttered with distracting mark-up.

Sentence structureEdit

English has a wide vocabulary but a fairly simple structure. Other languages often have different ways of arranging words, expressing verb tense, handling gender and number, and so on. Direct, simple language is easiest to translate and easiest to read. While preparing a page for translation, or updating a page, it is worth thinking about whether the sentences could be simplified. For example, wrapping a link around a phrase may give a result that is tough to translate and will surprise the reader when they click on it:

There is a {{pg|Commons:Some other page|straightforward approach to solving}} this problem.

The translator wants to use a very different word sequence. They can work out a way to handle the link-embedded phrase, but it takes thought and they have been slowed down. A better way to phrase the text may be:

{{pg|Commons:Some other page}} gives a simple way to solve this problem.

Short, positive sentences are best. Keep it simple.

PluralsEdit

In English, the number "one" is singular and all other numbers are plural, including zero. French, Hindi and other languages consider zero to also be singular: "no people" would seem ungrammatical. Some languages have two plurals: a "few" form for two, three and four, and a "many" form for larger numbers. For example, "1 stone, 2 stones, 5 stones" in the Russian language is "1 камень, 2 ка́мня, 5 камне́й". Some languages use the singular form for numbers above 20 that end in 1 (21, 31, 571 etc.), the "few" form for numbers above 20 that end in 2–4 (22, 134 etc.) and the "many" form for all other numbers.

None of this matters when the number is known: Consider the following three points: can be translated without difficulty. There is a problem when the number is returned by a function, as with: It is {{Years since|2018}} years since this was written. Is that a single year, a few years or many years? The answer will change as time passes.

The solution is to use the {{PLURAL:}} parser function:

It is {{Years since|2018}} {{PLURAL:{{Years since|2018}}|year|years}} since this was written.

This would render something like It is 1 year since this was written. The form of the word "year" will depend on the number of years that have passed since 2018 and the page language.

See Tvar (below) for ways to make this easier for translators to follow.

Size of unitsEdit

 
The translation interface (click to enlarge). The windows for viewing source text and entering translated text are relatively small.

A translation unit, a chunk of text between <translate> and </translate> tags, should not be too small or too big.

  • Section headings are normally marked as translation units.
  • The contents of a cell in a table may be a unit, even if not a full sentence, or adjacent cells in a table row may be combined in one unit.
  • With lists, particularly ones where entries may be added or removed periodically, each list entry may be a translation unit.
  • Otherwise a translation unit is normally two or three complete sentences – no more than fits comfortably below the English text in the translation interface.

A paragraph can be broken into two or more units by inserting pairs of </translate> and <translate> tags:

... end of sentence three.
</translate>
<translate>
Start of sentence four ...

The displayed text will flow in the normal way, with no line break:

... end of sentence three. Start of sentence four ...

ListsEdit

Mainstream newspapers rarely use simple or bulleted lists, and use numbered lists almost exclusively for rankings such as "The 10 richest people". Sometimes a list is the best way to present information, but you may want to consider changing numbered or indented lists to single-level bulleted lists. Item numbers are rarely significant, and indentation can confuse readers and may get dropped by translators. A list with a small number of short entries may be made a single translation unit, but should it be a list at all? Compare

There are four points to the compass:
 1. North
 2. South
 3. East
 4. West

to the simpler and more natural:

There are four points to the compass: North, South, East and West.

If the list entries are likely to be added and changed quite often, it should be broken down into units:

* List entry one
</translate>
<translate>
* Next list entry
</translate>
<translate>
* Another list entry
...

The mark-up as shown above, with </translate> and <translate> each on their own line, is safest. Mark-up like:

* List entry one
</translate><translate>
* Next list entry

will give unexpected results.

Complex list structures break down when parts of the list are marked as out-of-date. Thus:

  1. First entry in the list
  2. Second entry in the list
    • Sub-entry bullet
    • Another sub-entry bullet
  3. Third entry in the list

becomes:

  1. First entry in the list
  2. Second entry in the list
    • Sub-entry bullet
    • Another sub-entry bullet
  1. Third entry in the list

Simple lists are best!

Sorted listsEdit

An alphabetical list in English may be in random order when translated into another language. "South Africa" is under "S" in English, and "Germany" is under "G", but "Afrique du Sud" and "Allemagne" are under "A" in French. If the list is too long to be put into one unit that a translator can sort, it may be better to break it into smaller sub-lists to help the reader find what they are looking for. Thus a list of countries could be divided into lists by continent, and these could in turn be divided into lists by region, which may be small enough to be sorted by the translator.

See Commons:Copyright tags index help for a more elaborate approach to sequencing a large list of country names.

Hiding mark-upEdit

The volunteers who create and maintain translations of project pages understand common wiki mark-up, but it is easier for them if lengthy strings of untranslatable mark-up are hidden. For example, a definition table could be marked up like:

</translate>
{| class="wikitable" style="width:100%" ...
|- style="background:"
|align="center"| [[Image:Inkscape Logo.svg|48px]]
<translate>
| Inkscape
| Creator of [[:en:Scalable Vector Graphics|SVG]] vector images. It can also be used to export [[w:Portable Network Graphics|PNG]].
</translate> ...

The translator just sees:

| Inkscape
| Creator of [[:en:Scalable Vector Graphics|SVG]] vector images. It can also be used to export [[w:Portable Network Graphics|PNG]].

This still has mark-up, but not so much as to be distracting. The name "Inkscape" has been left visible to give the translator context, even though it will not be translated. The interwiki links to articles describing SVG and PNG have also been left visible. The translator may be able to add better links for the target language. But see Links to Wikipedia (above).

TvarEdit

"Tvar" is short for "Translation variable". It gives a way to hide untranslatable details and frequently-changed values from the translated versions when the text to be hidden is part of a sentence. When the value within the tvar tags is changed in the English version, the change is reflected in all the translated versions. The markup format is:

Start of sentence <tvar|name> ... hidden text or variable ... </> more text

The name of a tvar must be unique within a translation unit, but the same name may be reused in other units of the same page. Also the same name can be reused within the translation unit if it has exactly the same content each time (this is more of a concern in templates, though).

Example 1
English version See [<tvar|url1>https://www.long_and_unstable_url.com?14567ty65fd346&r=qen</> ABC page] for details.
Translator sees See [$url1 ABC page] for details

Context is important. The variable has been given a short name that says what kind of thing it is, which is helpful to the translator, and the square brackets [] and page name have not been masked out, so the translator can see it is a typical [url name] type of external link. They may or may not translate "ABC page".

Example 2
English version Copyright has expired if the author died before <tvar|year1>{{#time:Y|now -70 years}}</>.
Translator sees Copyright has expired if the author died before $year1.

Again, the variable has been given a short name that says what kind of thing it is. The {{#time}} function has been hidden so there is no risk that the translator will decide to translate "now -70 years".

Example 3
English version It is <tvar|num1>{{Years since|2017}}</> {{PLURAL:<tvar|num2>{{Years since|2017}}</>|year|years}} since this was written.
Translator sees It is $num1 {{PLURAL:$num2|year|years}} since this was written.

The translator may have to check the the {{PLURAL:}} parser function documentation to see how to translate this, but at least some of the untranslatable code has been hidden.

Structural techniquesEdit

Navigation templatesEdit

Navigation templates include navbars along the top of a page, navboxes in the upper right and larger navboxes at the foot of the page. They can be translated using the extension in the same way as regular pages. This is preferable to the old {{Autotranslate}} approach. As discussed above, the formatting mark-up can be hidden from the translations. The template's <languages/> bar should be hidden when when the template is transcluded:

<noinclude><languages/></noinclude>

A translated navigation template should be transcluded with the syntax:

{{TNT|templatename}}

{{TNT}} renders the translated version of the template in the current page language if available, or in English if not. It can be used on both translated and untranslated pages. Although designed for use on project pages, it can accept a language other than the page language, e.g.

{{TNT|templatename|uselang={{int:lang}}}}

This renders the template in the user's preferred language if available, or in English if not. It is suitable for use on non-project pages.

Script directionEdit

Most languages use left-to-right script, but Arabic, Persian/Farsi, Urdu, Hebrew etc. use right-to-left scripts. The page language will cause text to be rendered correctly, and thumbnail images will by default float to the margin opposite the start of the text, but a trick is needed to make sure other floating elements such as navigation templates are formatted correctly. An element may be coded as:

<div style="float:right; margin-left:2em; padding:5px; border:1px solid blue>[[File:Star icon stylized.svg|20px|left]] Example template text</div>

The box floats to the right of the text, which is correct for left-to-right languages.

Example template text
Lorem ipsum dolor sit amet, duis dicunt consulatu qui ea. Pri mundi luptatum salutandi eu, vis primis possim aliquando ne. Tempor scriptorem ea per, vix in eros option. Rebum decore doctus no pro, an eum doctus constituam. Eligendi convenire eu vel, vide dicant quo ad, at odio dictas constituam mel. Nam option recusabo scripserit ea, per id nobis primis platonem.

However, with a right-to-left language, it floats before (to the right of) the text as:

Example template text
اللغة الأردية لغة هندية آرية من فرع اللغات الهندية الإيرانية، تنتمي إلى عائلة اللغات الهندية الأوروبية. هي اللغة الرسمية في باكستان، وتعد واحدة من 22 لغة في الهند وهي لغة رسمية في خمس ولايات هندية. تطورت مفرداتها من اللغة السنسكريتية والفارسية والعربية والتركية والبشتونية. وفي في العصر الحديث، تأثرت الأردية بمفردات اللغة الإنجليزية تأثراً كبيراً نتيجة الاستعمار البريطاني للهند. كان أساس تطور اللغة الأردية في غرب ولاية أوتار براديش الهندية التي تعد مقر اللغة الهندوستانية الرئيسي.

This is awkward. The problem can be resolved by using the {{Dir}} template to define how the element should float, and where the margins, padding etc. should be placed:

<div style="float:{{dir|{{PAGELANGUAGE}}|left|right}}; margin-{{dir|{{PAGELANGUAGE}}|right|left}}:2em; padding:5px; border:1px solid blue;">[[File:Star icon stylized.svg|20px|{{dir|{{PAGELANGUAGE}}|right|left}}]] Example template text</div>

In a right-to-left language, this appears correctly as:

Example template text
اللغة الأردية لغة هندية آرية من فرع اللغات الهندية الإيرانية، تنتمي إلى عائلة اللغات الهندية الأوروبية. هي اللغة الرسمية في باكستان، وتعد واحدة من 22 لغة في الهند وهي لغة رسمية في خمس ولايات هندية. تطورت مفرداتها من اللغة السنسكريتية والفارسية والعربية والتركية والبشتونية. وفي في العصر الحديث، تأثرت الأردية بمفردات اللغة الإنجليزية تأثراً كبيراً نتيجة الاستعمار البريطاني للهند. كان أساس تطور اللغة الأردية في غرب ولاية أوتار براديش الهندية التي تعد مقر اللغة الهندوستانية الرئيسي.

In templates TemplateStyles can be used, which automatically swaps left and right:

<div class="mytemplate"><templatestyles src="Mytemplate/styles.css" />[[File:Star icon stylized.svg|20px|{{dir|{{PAGELANGUAGE}}|right|left}}]] Example template text</div>

where Template:Mytemplate/styles.css is:

.mytemplate {
    float: right;
    margin-left: 2em;
    padding: 5px;
    border: 1px solid blue;
}

CategoriesEdit

A translatable English page may define a category at the foot like:

</translate>

[[Category:Commons help]]

With this, all the translated versions will also be placed in Category:Commons help. A better way is:

</translate>

[[Category:Commons help{{#translation:}}]]

This will put the English page in Category:Commons help and the translated versions in categories such as Category:Commons help/fa. The language categories can in turn be placed in a category like Category:Commons help by language.

TransclusionEdit

Sometimes it is useful to transclude a section from a translated page. {{CRT section/transclude}} illustrates the syntax. Note that this will not work for the base English version of a page. Instead, you should transclude from the rendered "translation" of the page into English. That is,

  • Do not transclude from [[pagename]]
  • Instead, transclude from [[pagename/en]]

This is how the {{TNT}} template avoids problems when transcluding a translated template.

Page migrationEdit

A translation administrator can use the Special:PageMigration tool to migrate a set of older page translations to the Translate Extension. See MediaWiki Migrating to page translation for documentation. The pages are first moved to names like parentname/xy, where "xy" is the ISO code for the translated page language. They are then edited to make migration easier, and the parent English page is marked for translation. Next the text of each page is matched against the parent page translation units using the migration tool, and saved in the new format. Finally, the page versions are reviewed to correct format errors and other problems.

Page names and deprecated languagesEdit

Before starting migration, you must move the pages to names like Commons:pagename/xy, where xy is the ISO language code. Usually there is a navigation bar at the top of each page (often wrapped in the {{Header}} template) that lists all the translated versions. It gives the translation language codes and page names, as shown below. Take a copy of the navbar template and keep it in a text editor like Notepad++. It will be useful during the migration. Check the template usage as well ("what links here"): sometimes pages have been translated, the navbar has been placed on the translation, but the backlink is missing from the navbar.

Beware of the deprecated languages. These include:

Language Do not use Instead use
Alemannisch als gsw
Chinese zh-hans, zh-hant, zh-cn, zh-hk, zh-mo, zh-my, zh-sg, zh-tw zh
Gan Chinese gan-hans, gan-hant gan
Inuktitut ike-cans, ike-latn iu
Kazakh kk-cyrl, kk-latn, kk-arab, kk-kz, kk-tr, kk-cn kk
Language Do not use Instead use
Kurdish ku-latn, ku-arab ku
‎Norsk no nb
Shi shi-tfng, shi-latn shi
Serbian sr-ec, sr-el sr
Tajik tg-latn tg

Migrate als to gsw, no to nb, zh-hans and zh-hant to zh, and so on. If there are versions in both zh-hans and zh-hant, pick the version that seems most complete and recent, and add a link in the "See also" section to the other version. (Simplified and traditional Chinese, and variants like zh-tw or zh-hk, are the same language but use different characters to represent words. A converter picks the character set to display based on the user's choice in Special:Preferences.)

If you accidentally use a deprecated language code, the migration tool will migrate the translated text to the old language code, but when anyone tries to update it they will be forced into the new language code. The old translation is frozen. You will have to cut-and-paste migrate each unit into the new language code, using comments to attribute the source, then ask an administrator to delete the frozen version in the old language code.

PreparationEdit

It helps to tidy up the English and translated versions before starting to migrate the translations. Make sure each heading line is preceded and followed by a blank line. Add blank lines before and after each list. Convert links to Commons and Help pages to use {{Pg}}. These include links like [[Commons:pagename]], [[Special:MyLanguage/Commons:pagename]] and {{localized link|Help:pagename}}.

When this is done, add <languages/>, <translate>, <tvar|> etc. tags to the English version, and click on "mark this page for translation" to review and approve the translation units. The languages navbar will appear at the top of the page listing all the translated versions, but they will all be in English. It may take several minutes or even hours before the background tasks complete, and during that period there is nothing more to be done. You can check the status by trying to translate the page title of one of the versions, using the page name in the former navbar template. If that is rejected, you have to wait.

MigrationEdit

 
Migration tool screenshot

When the system accepts a translation attempt, you can migrate the translated versions one by one. First, click the "Translate" tab, select the page title, and replace the English name with the translated name from the old navbar template. You may want to enter all the translated page titles before migrating the text, or you can enter each page title before or after migrating the page text.

To migrate a translated version, open the Special:PageMigration tool and enter the translated page name. The tool shows the English units to the left and the translated units to the right. The job is to match them up so each translated unit is opposite the corresponding English unit. Action icons to the right let you add, swap and delete translated units. Be careful: if you accidentally delete a unit, there is no way to undo the action. You can split a unit by adding a blank unit below it, and then cutting and pasting text into the blank unit.

If you are not familiar with the language you are migrating, you can use [Google translate] to get a rough translation of each unit. Usually (but not always) that will show it corresponds to one of the English units. It is best to preserve but flag outdated text. If a translated unit does not seem to correspond exactly to an English unit, add the text !!FUZZY!! at the start of the unit, which will highlight it for review by a translator.

Wrap-up and reviewEdit

A final step with each page version is to review the result and make corrections where needed. Common problems are incorrect headings levels, incorrect or missing list mark-up, and red links. Correct these using the main translation interface.

If you get mixed up, all is not lost. You can view the history of a translated version, pick the last version before translation, add &action=edit to the end of the url and press Enter. E.g.

https://commons.wikimedia.org/w/index.php?title=Commons:Blocking_policy/fr&oldid=120694447&action=edit

The system will not let you edit the old version, but will show the text with wiki markup. You can copy and paste into the translation windows. In the worst case you can migrate a complete page with the standard translation interface by cutting and pasting from the old version. Be sure to add comments attributing the text to the source version, e.g.

Content copied from [[Commons:Primeiros passos/Qualidade e descrição]] - version [[Special:PermanentLink/352926271]]</nowiki>.

See alsoEdit