CCWiki:Translate

From Creative Commons
Jump to: navigation, search

This is a multilingual wiki; content can be translated into multiple languages regardless of the original language.

Overview

This article describes how to go about translating virtually any page in the CC wiki. In order for translations to be organized, up to date, and associated with the correct source page, certain steps need to be taken. This is a brief overview of the steps required to translate a page correctly. For more detailed information about special rules and exceptions, please see the full documentation below, starting at subsection Preparation.

The first step in translating a page is, obviously, to select which page you would like to translate, and to note the title of that page. You then need to create a new page with the title translated and prefixed by the language code for your language. As an example, let's say you would like to translate the CC FAQ to Spanish. The page's title is Frequently_Asked_Questions, so the page title of your translation could be, for example, Es:Preguntas_Frecuentes. You then create this new page and add your translation of the FAQ to it, so that it looks identical to the original page, but translated. For detailed (and important!) information on naming a translated page please see subsection Naming Translated Pages below.

Once you have completed your page translation, how will other people find it? This is accomplished by adding a small bit of markup to the bottom of both the original page and your translation. See subsection Translate below to find out what markup must be entered on each page. When done correctly, the original page should contain a box at the bottom of the page indicating which languages the page has been translated to. Additionally, each translated page should contain a box at the bottom of the page linking to the original source of the translation. In this way, it should be easy for anyone to know what translations exist, and to link back and forth between the original page and the translation(s) of that page.

The text in these boxes can be translated, and this is recommended, though it is not 100% necessary in order to translate. To learn how to translate these boxes see the section Preparation below.

Preparation

The following templates are used to manage translations in the pages that are written in English:

There is a third, Template:Diff since trans, which is a support template used by the second, and not meant for general use. They are language interfaces that provide, to the real code behind, strings to be displayed to users, in English.

If these templates have not yet been translated to your language, you should translate the three of them first (see next section for how to do this — also see the European Portuguese (Pt:) versions of the templates for a practical example; you can, inclusively, translate the parameter names of the templates).

Once these have been translated to your language, you should use the translated versions on all pages written in your language, instead of the English ones. Generally, the English templates should be used in the pages in English, the German translations in the pages in German, the Hebrew translations in the pages in Hebrew, and so forth.

Translating

Follow these steps to translate an article. For the purposes of illustration, the article is called Example Content and we will translate the article to Spanish.

  • Create a new article called Es:Contenido de Ejemplo. The contents should be a translation of Example Content. Note that the page name is made up of the language code and the translated title, separated by a colon (:). See Naming Translated Pages below for additional details
  • To the bottom of page Es:Contenido de Ejemplo add the Spanish equivalent of:
{{Translated From
| source = Example Content
| rev = <revision ID of page Example Content>
}}
  • To the bottom of Example Content add:
{{Translations
| articles = Es:Contenido de Ejemplo
}}
Note: To get the <revision ID of page Example Content>, go to page Example Content and place the pointer over the link "Permanent link" at the top of the page; the revision ID will appear at the end of the URL near the bottom of your browser. It is also available from the history of the page, placing the pointer over the link to the last revision. Is is also shown in the languages box, in the link to the source language.
Note: If an article is available in more than two languages, separate the translated article names with commas in template Translations.
Note: For pages outside the main namespace, the namespace must always be specified at the beginning of the name.

A languages box appears at the bottom of each article. The box lists all languages in which the article is available. On translation pages, the box has a special behaviour: one of two indicators will appear after the name of the language of the page:

  • A ✔ if the latest revision of Example Content is equal to the revision ID supplied in parameter rev. This indicates that Es:Contenido de Ejemplo is up-to-date, since it is based on the latest version of the source page.
  • A "(synchronise)" link if the latest revision of Example Content is different from the revision ID supplied in parameter rev. This indicates that Es:Contenido de Ejemplo is outdated. Clicking the "(synchronise)" link produces a list of the changes made to Example Content since it was translated. To bring the translation into synch again, incorporate those changes in Es:Contenido de Ejemplo and update the revision ID to the latest one.

Eventually you will be able to read the entire wiki in your language.

Naming Translated Pages

The page name of pages outside the main namespace must be preceeded by the namespace (see subsection Namespace Prefix below for details).

When naming the translated page, the original page name should be translated.

To distinguish between identically spelt translated titles in different languages, language code prefixes are used (see subsection Language Code Prefix below for details).

The language code prefix should be followed by a colon (:) in all namespaces except "File:", where a space ( ) must be used instead (see subsection Exception for the File: namespace below for details).

So:

Again, please note that, for files, a space ( ) is used after the language code, instead of a colon (:).

Language Code Prefix

The language code must be supported by MediaWiki. A full list of the supported language codes can be found at TranslateWiki: SupportedLanguages.

Namespace Prefix

If the original page title has a namespace prefix, the same prefix needs to appear before language prefixes in the name of the translated page. For example, if you are translating this page (CC Wiki:Translate) into Spanish (es), the resulting page name would start with CC Wiki:Es:....

Exception for the File: namespace

When translating images, follow the language prefix guidelines above with the exception that the prefix should be followed by a space ( ) rather than a colon (:). For example, the Portuguese (pt) translation of File:Casestudies-splash.jpg is File:Pt Casos de estudo.png.

This exception is justified by the fact that MediaWiki automatically changes colons to dashes (-) in the title of the file description page. Since dashes are already used to separate language, region and script codes, using a space instead of a dash allows the page name to be exploded unambiguosly.

Categorisation of pages

There are a couple of issues with the categorisation of pages.

By default, in categories, the pages are sorted according to their full name, including the namespace. All pages in the "Category:" namespace, for example, will be listed in categories under the heading "C".

Additionally, since we prefix page names with the language code, even in the main namespace there will be sorting issues. For example, by default all pages in the main namespace written in German will be listed in categories under the heading "D", because all pages in German start with "De:".

To overcome these limitations, the translation templates automatically assign a default sort key to pages, which causes the page to be sorted under the part of its name after the language code. For most purposes this will be sufficient and users won't need to worry about categorisation (check Template:Sort key of page for precise details).

If, however, the default sort key ever turns out to be incorrect, it can be overriden as usual by:

[[Category:Name|Sort key override]]

on each category, or by a separate:

{{DEFAULTSORT:Sort key override}}

which applies to all the categories of the page. In principle, this should only be necessary when MediaWiki's handling of the initial caracters of the default sort key is undesired. For example, MediaWiki groups pages starting by A, À, Á, Ä, etc., under separate headers, instead of grouping all such pages under the heading A. If the name of a page (after the language prefix) starts by one such character, you may need to override the key.