Translating/HowTo: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
m (cosmetics + minor changes)
Line 8: Line 8:
{|
{|


|- valign="top"
|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page]]</nowiki> !! <span style="font-size:80%">''(translated page does not exist&mdash;yet)''</span>
! <nowiki>[[Original page]]</nowiki> !! <span style="font-size:80%">''(translated page does not exist&mdash;yet)''</span>


Line 33: Line 33:
{|
{|


|- valign="top"
|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page]]</nowiki> !! <span style="font-size:80%">''(translated page does not exist&mdash;yet)''</span>
! <nowiki>[[Original page]]</nowiki> !! <span style="font-size:80%">''(translated page does not exist&mdash;yet)''</span>


Line 57: Line 57:


<div style="font-size:80%; ">
<div style="font-size:80%; ">
{| cellspacing=0
{|


|- valign="top"
|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page/translations]]</nowiki>
! <nowiki>[[Original page/translations]]</nowiki>


Line 74: Line 74:
=== Setting up the translated page ===
=== Setting up the translated page ===


There are several ways that you can decide to actually translate a page. But there are some things that you want to keep in mind. First of all, you must declare it as a [[Template:Translation|<nowiki>{{Translation}}</nowiki>]] (please not the ''singular'' (plural is for the original page, that has many translations). Second, you want to keep navigation and linking within the translated pages easy. And finally, you may want to preserve the original text in the translation in order to simplify the maintenance.
There are several ways that you can decide to actually translate a page. But there are some things that you want to keep in mind. First of all, you must declare it as a [[Template:Translation|<nowiki>{{Translation}}</nowiki>]] (please note the use of the ''singular'' (plural is for the original page, that has many translations). Second, you want to keep navigation and linking within the translated pages easy. And finally, you may want to preserve the original text in the translation in order to simplify the review and maintenance.


The easiest way to set it up, is to go back to the original page, copy the '''wiki-text''' (in other words, either follow the ''edit'' (or ''view source'' if protected) and copy it fully and paste it to the new page.
The easiest way to set it up, is to go back to the original page, copy the '''wiki-text''' (in other words, either follow the ''edit'' (or ''view source'' if protected) and copy it fully and paste it to the new page.
Line 83: Line 83:
{|
{|


|- valign="top"
|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span>
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span>


Line 117: Line 117:
|}
|}
</div>
</div>
For a full explanation of the parameters, see the [[#Notes|Notes]] below, in short:
'''lang''' &mdash; is the [http://www.iana.org/assignments/language-subtag-registry IANA language code] (usually 2 letters, and no


==== Preserving the anchors ====
==== Preserving the anchors ====
Line 127: Line 129:
{|
{|


|- valign="top"
|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span>
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span>


Line 169: Line 171:
</div>
</div>


Note how the links don't really change except for the embedding of the <tt>/lang-xx</tt> part and the addition of the translated ''visual'' of the link (ie: <tt>|translated visual]]</tt>).
Note how the links don't really change except for the embedding of the <tt>/lang-xx</tt> part and the addition of the translated ''visual'' of the link (ie: <tt>|translated visual]]</tt>). The biggest advantage of this technique is that translating a reference is as easy as adding the target language in it and giving it a sensible name to display it.


At the beginning, any link you 'translate' will actually point to a non-existing page, don't worry. Just follow the link and make it look like:
== Full example ==
<div style="font-size:80%; ">
<div style="font-size:80%; ">
{|
{|

|- valign="top" style="background:lightgray; "
! <nowiki>[[Another page/lang-xx]]</nowiki>


|- valign="top"
|- valign="top"
|
<nowiki>#REDIRECT [[Another page]]</nowiki>
<nowiki>[[Category:Missing translation]]</nowiki>
|}
</div>
This will serve three purposes, first the page will at least take the reader to the right page (albeit not in the correct language). Secondly, the ''Category'' will allow a simple way to check 'what is missing'. Finally, and using the ''What links here'' from the '''toolbox''' you can gauge how many references to the missing page exist, giving some sense of ''need'' for it and thus guiding the translating efforts.

== Full example finished ==
<div style="font-size:80%; ">
{|

|- valign="top" style="background:lightgray; "
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span> !! Translated text deleted...<span style="font-size:80%"><br>''(not really recommended)''</span>
! <nowiki>[[Original page]]</nowiki> !! <nowiki>[[</nowiki>Original page/lang-[[#lang|xx]]<nowiki>]]</nowiki><span style="font-size:80%"><br>''(translated page name)''</span> !! Translated text deleted...<span style="font-size:80%"><br>''(not really recommended)''</span>


Line 238: Line 255:
; shortNativeName : should be in the native language; <tt>español</tt> instead of <tt>spanish</tt>.
; shortNativeName : should be in the native language; <tt>español</tt> instead of <tt>spanish</tt>.


=== [[Template:Translation|Translation]] ===
=== [[Template:Translation|Translation]] template ===


For the full documentation, please see [[Template:Translation]].
For the full documentation, please see [[Template:Translation]].
Line 253: Line 270:
; version : is a bit of a tricky until you understand it, but extremely helpful.
; version : is a bit of a tricky until you understand it, but extremely helpful.
: The number associated with the parameter comes from the '''original''' page, and has been made explicit in the blue language navigation bar at its right: <tt>'''[ID# ''yyyy'']'''</tt>.
: The number associated with the parameter comes from the '''original''' page, and has been made explicit in the blue language navigation bar at its right: <tt>'''[ID# ''yyyy'']'''</tt>.
: Pages in the wiki have a ''numeric id'', and each edition creates a new ID. So when you start translating a page, you want to register which ''version'' you started. When at some point the source page is modified, its current version will have a higher version number. If you follow the ''changes'' link in the translation blue bar, the system will report all the changes done in that page from the ID# you started from. Once you update the translation, '''do not forget to update''' the version # to match the latest sync'ed to number!
: Pages in the wiki have a ''numeric id'', and each edition creates a new ID. So when you start translating a page, you want to register which ''version'' you started from. When at some point the source page is modified, its current version will have a higher version number. If you follow the ''changes'' link in the translation blue bar, the system will report all the changes done in that page from the ID# you started from. Once you update the translation, '''do not forget to update''' the version # to match the latest sync'ed to number!
: so when you compare the differences between two pages, internally you are comparing two IDs between them.
: so when you compare the differences between two pages, internally you are comparing two IDs between them.
: For example [http://wiki.laptop.org/index.php?title=Template%3ATranslation&diff=35092&oldid=39128 this diff] is actually comparing two pages, NOT two versions of the same page.
: For example [http://wiki.laptop.org/index.php?title=Template%3ATranslation&diff=35092&oldid=39128 this diff] is actually comparing two pages, NOT two versions of the same page.


=== [[Template:Translated text|Translated text]] ===
=== [[Template:Translated text|Translated text]] template ===


<div id="display"/>
<div id="display"/>

Revision as of 23:31, 24 May 2007

Step-by-step

We'll assume that you want to translate a page that is maintained by the OLPC team (so it will have a reference to the {{OLPC}} template), as they are usually the entry points or that consolidate information that is more helpful for the local communities.

[[Original page]] (translated page does not exist—yet)
{{OLPC}}

== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah

Adding the language bar

Although ever more rare, you may find yourself wanting to translate a page that nobody else has translated. In that case, you need to add a translations navigation bar in the original page.

[[Original page]] (translated page does not exist—yet)
{{OLPC}}
{{Translations}}

== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah

Setting up the /translations

You should follow the [[Original page/translations]] link in order to edit the page that groups the translations of a particular page, and should look something like this:

[[Original page/translations]]
[[Original page|english]] | [[Original page/lang-xx|shortNativeName]]

The resulting page will have a red link, denoting a missing/broken link to you future translation. Don't worry, you'll fix that in the next step.

NOTE: Although you could give any name to the translated page (ie: instead of "The OLPC Wiki/lang-es" you could do "El Wiki de la OLPC"). As a matter of fact, there are quite some pages that follow that structure, but most of them are either left overs from when there wasn't a clear structure and way for adding translations. As mentioned in the translating pages, there are advantages to sticking with the /lang-xx structure, particularly because you can always create redirects in the native language to you translated version.

Setting up the translated page

There are several ways that you can decide to actually translate a page. But there are some things that you want to keep in mind. First of all, you must declare it as a {{Translation}} (please note the use of the singular (plural is for the original page, that has many translations). Second, you want to keep navigation and linking within the translated pages easy. And finally, you may want to preserve the original text in the translation in order to simplify the review and maintenance.

The easiest way to set it up, is to go back to the original page, copy the wiki-text (in other words, either follow the edit (or view source if protected) and copy it fully and paste it to the new page.

Adding the {{Translation}} template

[[Original page]] [[Original page/lang-xx]]
(translated page name)
{{OLPC}}
{{Translations}}


== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah
{{OLPC}}
{{Translation
 | lang = xx
 | source = Original page
 | version = yyyy}}

== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah

For a full explanation of the parameters, see the Notes below, in short: lang — is the IANA language code (usually 2 letters, and no

Preserving the anchors

Many times, when translating you may find links between pages (translated or not) that point to a particular section. When translating this, you may find yourself either ignoring if the target page was translated, under which name if it was so, and last but not least, what is the translated header. That is not to mention the fact that maybe the translated header may be corrected or otherwise changed in future editions.

The solution is to avoid it altogether and let the original structure work for us (or almost).

[[Original page]] [[Original page/lang-xx]]
(translated page name)
{{OLPC}}
{{Translations}}


== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah
{{OLPC}}
{{Translation
 | lang = xx
 | source = Original page
 | version = yyyy}}

<div id="Some header"/>
== Un titular ==

Algo de texto bla... 
bla... [[#Another header|Otro titular]]
... blah {{ Translated text | Some text blah...
blah... [[#Another header]]
... blah | display = block}} <div id="Another header"/> == Otro titular == Algo más de texto bla...
bla... [[Another page/lang-xx|Otra página]]
y [[Another page/lang-xx|sección]]
... bla {{ Translated text | Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah | display = block}}

Note how the links don't really change except for the embedding of the /lang-xx part and the addition of the translated visual of the link (ie: |translated visual]]). The biggest advantage of this technique is that translating a reference is as easy as adding the target language in it and giving it a sensible name to display it.

At the beginning, any link you 'translate' will actually point to a non-existing page, don't worry. Just follow the link and make it look like:

[[Another page/lang-xx]]
#REDIRECT [[Another page]]
[[Category:Missing translation]]

This will serve three purposes, first the page will at least take the reader to the right page (albeit not in the correct language). Secondly, the Category will allow a simple way to check 'what is missing'. Finally, and using the What links here from the toolbox you can gauge how many references to the missing page exist, giving some sense of need for it and thus guiding the translating efforts.

Full example finished

[[Original page]] [[Original page/lang-xx]]
(translated page name)
Translated text deleted...
(not really recommended)
{{OLPC}}
{{Translations}}


== Some header ==

Some text blah... 
blah... [[#Another header]]
... blah == Another header == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah
{{OLPC}}
{{Translation
 | lang = xx
 | source = Original page
 | version = yyyy}}

<div id="Some header"/>
== Un titular ==

Algo de texto bla... 
bla... [[#Another header|Otro titular]]
... blah {{ Translated text | Some text blah...
blah... [[#Another header]]
... blah | display = block}} <div id="Another header"/> == Otro titular == Algo más de texto bla...
bla... [[Another page/lang-xx|Otra página]]
y [[Another page/lang-xx|sección]]
... bla {{ Translated text | Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah | display = block}}
{{OLPC}}
{{Translation
 | lang = xx
 | source = Original page
 | version = yyyy}}

<div id="Some header"/>
== Un titular ==

Algo de texto bla... 
bla... [[#Another header|Otro titular]]
... blah <div id="Another header"/> == Otro titular == Algo más de texto bla...
bla... [[Another page/lang-xx|Otra página]]
y [[Another page/lang-xx|sección]]
... bla

Notes

shortNativeName
should be in the native language; español instead of spanish.

Translation template

For the full documentation, please see Template:Translation.

lang
This parameter identifies the target language of the translation.
It serves several purposes, and is used in several contexts although it should be done in a homogeneous way.
We are currently using ISO 639-1 codes (two-letter codes), although we should probably migrate to 639-3 (three letter codes).
source
is the name of the page (not the link—in other words, without the enclosing square brackets).
version
is a bit of a tricky until you understand it, but extremely helpful.
The number associated with the parameter comes from the original page, and has been made explicit in the blue language navigation bar at its right: [ID# yyyy].
Pages in the wiki have a numeric id, and each edition creates a new ID. So when you start translating a page, you want to register which version you started from. When at some point the source page is modified, its current version will have a higher version number. If you follow the changes link in the translation blue bar, the system will report all the changes done in that page from the ID# you started from. Once you update the translation, do not forget to update the version # to match the latest sync'ed to number!
so when you compare the differences between two pages, internally you are comparing two IDs between them.
For example this diff is actually comparing two pages, NOT two versions of the same page.

Translated text template

display
is used to show or hide the enclosed translated text.
While doing the translation, it comes in handy for comparing the original with the translation. When finished, you can replace the block with none and the source text is not displayed. Although it adds quite a bit of text and 'noise' to the source of the translated page, it comes in handy when trying to update or synchronize it with any changes in the original page—after all, this IS a wiki and pages are supposed to mutate!