Difference between revisions of "CCWiki:Translate"

From Creative Commons
Jump to: navigation, search
(Undo revisions 39890, 39891 and 39892 by OpenIDUser450 (Talk))
m (Fixed the spanish translation for Example Content)
 
(77 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{Translations|
+
This is a multilingual wiki; content can be translated into multiple languages regardless of the original language.
  articles=Pt:CcWiki:Tradução
+
 
}}
+
== Overview ==
This is a multilingual wiki; content can be translated into multiple languages regardless of original language.  
+
 
 +
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 | 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 [http://translatewiki.net/wiki/Special:SupportedLanguages language code] for your language.  As an example, let's say you would like to translate the [[Frequently_Asked_Questions | 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 | 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 | 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 | Preparation]] below.
 +
 
 +
== Preparation ==
 +
 
 +
The following templates are used to manage translations in the pages that are written in English:
 +
 
 +
* [[Template:Translations]]
 +
* [[Template:Translated From]]
 +
 
 +
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 ==
 
== Translating ==
Line 8: Line 28:
 
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.
 
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 del 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|Naming Translated Pages]]'' below for additional details
+
* 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|Naming Translated Pages]]'' below for additional details
* To '''Es:Contenido del Ejemplo''' add:
+
* To the bottom of page '''Es:Contenido de Ejemplo''' add the Spanish equivalent of:
<pre><nowiki>
+
<pre>
  {{Translated From|
+
{{Translated From
    source=Example Content
+
| source = Example Content
  }}
+
| rev = <revision ID of page Example Content>
</nowiki></pre>
+
}}
* To '''Example Content''' add:
+
</pre>
<pre><nowiki>
+
* To the bottom of '''Example Content''' add:
  {{Translations|
+
<pre>
    articles=Es:Contenido del Ejemplo
+
{{Translations
  }}
+
| articles = Es:Contenido de Ejemplo
</nowiki></pre>
+
}}
 +
</pre>
 +
:'''''Note:''' To get the <code><revision ID of page '''Example Content'''></code>, 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 <code>Translations</code>.''
  
A box appears in each article listing the languages the article is available in. If an article is available more than two languages, separate the translated article names with commas in the <code>Translations</code> template.
+
:'''''Note:''' For pages outside the main namespace, the namespace must always be specified at the beginning of the name.''
  
Eventually you'll be able to search for articles only in language(s) you specify.
+
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 &#10004; if the latest revision of '''Example Content''' is equal to the revision ID supplied in parameter <code>rev</code>. 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 <code>rev</code>. 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 ==
 
== Naming Translated Pages ==
  
When naming the translated page the page should be prefixed with an identifier for the language you're translating to.  In the example above we were translating to Spanish.  The [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO-639-1 code] for Spanish is '''es'''. So the translated article name is prefixed by '''Es:'''
+
The page name of pages outside the main namespace must be preceeded by the namespace (see subsection [[#Namespace Prefix|Namespace Prefix]] below for details).
  
If the language you are translating to has different forms or vocabulary in different countries, you can also use the [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements country code]. For example, the "translation" of '''Example Content''' to English as spoken in the United Kingdom would be on the page '''En-GB:Example Content'''.
+
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|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 {{ns:file}}: namespace|Exception for the {{ns:file}}: namespace]] below for details).
 +
 
 +
So:
 +
 
 +
* [[Ru:Заглавная страница]] is the translation of [[Main Page]] to Russian (ru:)
 +
* [[He:ברוכים הבאים]] is the translation of the same [[Main Page]] to Hebrew (he:)
 +
 
 +
* [[CC Wiki:De:Übersetzen]] is the translation of this page, [[CC Wiki:Translate]], in the "CC Wiki:" namespace, to German (de:)
 +
* [[:Category:Ksh:Projäk]] is the translation of [[:Category:Project]], in the "Category:" namespace, to Colognian (ksh:)
 +
* [[Template:Ar:مشاركة الأعمال الإبداعية]] is the translation of [[Template:Sharing Creative Works]], in the "Template:" namespace, to Arabic (ar:)
 +
 
 +
* [[:File:Pt Casos de estudo.png]] is the translation of [[:File:Casestudies-splash.jpg]], in the "File:" namespace, to European Portuguese (pt:)
 +
 
 +
: ''Again, please note that, for files, a space ( ) is used after the language code, instead of a colon (:).''
 +
 
 +
* [[Case Studies/Silvia O in the remix culture]] is the translation of [[Case Studies/Es:Silvia O in the remix culture]], a subpage of [[Case Studies]] in the main namespace, into English (no language code used)
 +
 
 +
=== Language Code Prefix ===
 +
The language code must be supported by MediaWiki. A full list of the supported language codes can be found at [http://translatewiki.net/wiki/Special:SupportedLanguages TranslateWiki: SupportedLanguages].
 +
 
 +
=== Namespace Prefix ===
 +
 
 +
If the original page title has a [http://www.mediawiki.org/wiki/Help:Namespaces 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 (<tt>CC Wiki:Translate</tt>) into Spanish (<tt>es</tt>), the resulting page name would start with <tt>CC Wiki:Es:...</tt>.
 +
 
 +
==== Exception for the {{ns: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 [http://www.mediawiki.org/wiki/Help:Categories 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 [http://www.mediawiki.org/wiki/Help:Categories#Sort_key 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:
 +
 
 +
<pre>
 +
[[Category:Name|Sort key override]]
 +
</pre>
 +
 
 +
on each category, or by a separate:
 +
 
 +
<pre>
 +
{{DEFAULTSORT:Sort key override}}
 +
</pre>
 +
 
 +
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.
 +
 
 +
{{Translations|
 +
| articles = CC Wiki:Pt:Tradução, CC Wiki:Ksh:Övversäze, CC Wiki:de:Übersetzen
 +
}}
  
 
[[Category:Translation Project]]
 
[[Category:Translation Project]]

Latest revision as of 00:12, 15 October 2017

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.