Difference between revisions of "Translation Policy"

From LibrePlanet
Jump to: navigation, search
(Translation_Policy (rev. 1.0))
(Added 'Renaming/moving a master page' section + small fixes all around)
Line 26: Line 26:
 
So, the rule is: the translation page keeps the same (untranslated) name of the original page, plus a dot character followed by the 2-digits lowercase code (ISO 639-1) of the language used by the translation.
 
So, the rule is: the translation page keeps the same (untranslated) name of the original page, plus a dot character followed by the 2-digits lowercase code (ISO 639-1) of the language used by the translation.
  
This will result in better searches results, less confusion and more consistency of the wiki.
+
This will result in better searches findings, less confusion and more consistency of the wiki.
  
 
Example:
 
Example:
 
The Italian translation of the '''<tt>Main_Page</tt>''' of this wiki should be named as '''<tt>Main_Page.it</tt>'''.
 
The Italian translation of the '''<tt>Main_Page</tt>''' of this wiki should be named as '''<tt>Main_Page.it</tt>'''.
  
== Language bar ==
+
== Language bar ('Languages' template) ==
  
 
When some translation of a master page exist in the wiki, then either the master page or each of its translation pages should display (at their top) a language bar linking to all the available translations.
 
When some translation of a master page exist in the wiki, then either the master page or each of its translation pages should display (at their top) a language bar linking to all the available translations.
Line 56: Line 56:
 
{{Languages|master page=Main_Page|language=it}}
 
{{Languages|master page=Main_Page|language=it}}
 
</pre>
 
</pre>
Please, note that in both cases the template is called referring to the same master page, but for the page in English is used the code 'en' while for the page in Italian is used the code 'it.'
+
Please, note that in both cases the template is called referring to the same master page, but for the page in English is used the code ''''<tt>en</tt>'''' while for the page in Italian is used the code ''''<tt>it</tt>''''.
  
 
=== 'Language code' property ===
 
=== 'Language code' property ===
  
When using the [[Template:Languages]], it also sets the Semantic MediaWiki property ''''Language code'''' for the calling page to the <LangCode> parameter value. This property value could then be used in semantic queries and searches.
+
When using the [[Template:Languages]], it also sets the Semantic MediaWiki property ''''Language code'''' for the calling page to the <tt><LangCode></tt> parameter value. This property value could then be used in semantic queries and searches.
  
 
In other words, following the example above, when including in a page:
 
In other words, following the example above, when including in a page:
Line 66: Line 66:
 
{{Languages|master page=Main_Page|language=it}}
 
{{Languages|master page=Main_Page|language=it}}
 
</pre>
 
</pre>
it not only will display the language bar, but also will assign for that page the 'it' value to the semantic property 'Language code'. This means that page will be matched when searching/querying the Semantic MediaWiki for those pages having the 'Language code' property set to 'it'.  
+
it not only will display the language bar, but also will assign for that page the '<tt>it</tt>' value to the semantic property '<tt>Language code</tt>'. This means that page will be matched when searching/querying the Semantic MediaWiki for those pages having the '<tt>Language code</tt>' property set to '<tt>it</tt>'.  
 +
 
 +
== Renaming/moving a master page ==
 +
 
 +
In order to keep the [[Template:Languages]] working in the right way, when renaming/moving a master page the "old" master page should '''NOT be deleted''' and a [http://www.mediawiki.org/wiki/Help:Redirects redirection] to the "new" master page should be set. This is needed because the translation pages including the [[Template:Languages]] still refer to the "old" master page name.
 +
 
 +
Only if all the references to the "old" master page in its translation pages are updated with the new name, then the [http://www.mediawiki.org/wiki/Help:Redirects redirection] of the "old" master page is not required.
 +
 
 +
Example: To rename the <tt>Group:LibrePlanetTest\FooPage</tt> master page in <tt>Group:LibrePlanetTest\FooPageNew</tt> keeping at the same time the language bar correctly displaying its translation pages, the 'FooPage' should NOT deleted and its content should be replaced with:
 +
<pre>
 +
#REDIRECT [[Group:LibrePlanetTest\FooPageNew]]
 +
</pre>
  
 
== Aligning existing translation pages to this policy ==
 
== Aligning existing translation pages to this policy ==
Line 73: Line 84:
  
 
To do this:
 
To do this:
# the names of all the translation pages should be aligned to the [[#Naming of translation pages|format]] described above:
+
# the names of all the translation pages should be aligned to the [[#Naming of translation pages|naming format]] described above:
 
#* create a new page for the translation giving it the right name;
 
#* create a new page for the translation giving it the right name;
 
#* cut 'n paste ALL the content from the "old" translation page (that with the "wrong" name) to the "new" page just created (that with the "right" name);
 
#* cut 'n paste ALL the content from the "old" translation page (that with the "wrong" name) to the "new" page just created (that with the "right" name);
 
#* [http://www.mediawiki.org/wiki/Help:Redirects redirect] the "old" page to the "new" one;
 
#* [http://www.mediawiki.org/wiki/Help:Redirects redirect] the "old" page to the "new" one;
# either the master page and all its translation pages should be checked in order to adding a call to the [[Template:Languages]], using the [[#Language bar|format]]) described above, if it is missing (or wrong).
+
# either the master page and all its translation pages should be checked in order to adding a call to the [[Template:Languages]], using the [[#Language bar|calling format]] described above, if it is missing (or wrong).

Revision as of 16:23, 28 January 2011

Introduction

This documents defines the translation policy for the LibrePlanet wiki.

Terminology used in this document:

original [page]
master page
- refer to the original page (in the language used by the author) from which the translations are made;
translation [page]
- refers to a page that contains a translation of an original page.

Naming of translation pages

A translation page should be named in the following format:

<MasterPage>.<LangCode>

where:

<MasterPage>
is the name of the master page;
<LangCode>
is the 2-digits lowercase code (ISO 639-1) of the language used by the translation.

So, the rule is: the translation page keeps the same (untranslated) name of the original page, plus a dot character followed by the 2-digits lowercase code (ISO 639-1) of the language used by the translation.

This will result in better searches findings, less confusion and more consistency of the wiki.

Example: The Italian translation of the Main_Page of this wiki should be named as Main_Page.it.

Language bar ('Languages' template)

When some translation of a master page exist in the wiki, then either the master page or each of its translation pages should display (at their top) a language bar linking to all the available translations.

To do this, the master page and all its translation pages should call (at their top) the Template:Languages.

This template should be called in the following format:

{{Languages|master page=<MasterPage>|language=<LangCode>}}

where:

<MasterPage>
is the name of the master page;
<LangCode>
is the 2-digits lowercase code (ISO 639-1) of the language used for the content of the page from which the template itself is being called (no matter if it is the master page or one of its translations).

Example: The Main_Page of this wiki has been written in English, so it should include at top:

{{Languages|master page=Main_Page|language=en}}

its Italian translation page should include at top:

{{Languages|master page=Main_Page|language=it}}

Please, note that in both cases the template is called referring to the same master page, but for the page in English is used the code 'en' while for the page in Italian is used the code 'it'.

'Language code' property

When using the Template:Languages, it also sets the Semantic MediaWiki property 'Language code' for the calling page to the <LangCode> parameter value. This property value could then be used in semantic queries and searches.

In other words, following the example above, when including in a page:

{{Languages|master page=Main_Page|language=it}}

it not only will display the language bar, but also will assign for that page the 'it' value to the semantic property 'Language code'. This means that page will be matched when searching/querying the Semantic MediaWiki for those pages having the 'Language code' property set to 'it'.

Renaming/moving a master page

In order to keep the Template:Languages working in the right way, when renaming/moving a master page the "old" master page should NOT be deleted and a redirection to the "new" master page should be set. This is needed because the translation pages including the Template:Languages still refer to the "old" master page name.

Only if all the references to the "old" master page in its translation pages are updated with the new name, then the redirection of the "old" master page is not required.

Example: To rename the Group:LibrePlanetTest\FooPage master page in Group:LibrePlanetTest\FooPageNew keeping at the same time the language bar correctly displaying its translation pages, the 'FooPage' should NOT deleted and its content should be replaced with:

#REDIRECT [[Group:LibrePlanetTest\FooPageNew]]

Aligning existing translation pages to this policy

If a master page has one or more translation, then they should be checked in order to be aligned to this policy.

To do this:

  1. the names of all the translation pages should be aligned to the naming format described above:
    • create a new page for the translation giving it the right name;
    • cut 'n paste ALL the content from the "old" translation page (that with the "wrong" name) to the "new" page just created (that with the "right" name);
    • redirect the "old" page to the "new" one;
  2. either the master page and all its translation pages should be checked in order to adding a call to the Template:Languages, using the calling format described above, if it is missing (or wrong).