Translating/HowTo: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 252: Line 252:
When linking to a translated page in a particular language use the /lang-xx to point to that particular translation.
When linking to a translated page in a particular language use the /lang-xx to point to that particular translation.


Ex.
<nowiki>[[some-link/lang-de|einige-link]]</nowiki>
<nowiki>[[some-link/lang-de|einige-link]]</nowiki>


Line 260: Line 259:
reader or not.
reader or not.


Original text invisible to reader (display = none).
Ex. 1
Original text invisible to reader (display = none).
<nowiki>
<nowiki>
{{ Translated text |
{{ Translated text |
Line 272: Line 270:




Original text visible to reader (display = block).
Ex. 2
Original text visible to reader (display = block).
<nowiki>
<nowiki>
{{ Translated text |
{{ Translated text |

Revision as of 01:17, 20 November 2007

  english | español | 日本語 | 中文 | català | Indonesia HowTo [ID# 78779]  +/-  
Sugar framework
Python framework
Localizing an XO
Keyboards
Changing language
Translators
Getting started
Website translation
modify 

There are many issues that make translating a not-so-simple act. The very nature of a wiki (highly mutable sources) complicates them. What follows is the sequence of steps allowing for a homogeneous structure in the wiki. Hopefuly this will allow anybody to collaborate in the Translating effort without too much overhead.

Step-by-step

From the point-of-view of the wiki, there are basically three tasks to hook up a translated page:

  1. modify the source page — if it has never been translated;
  2. adding a reference — point/link to the translation in a standard way; and
  3. conditioning the translated page — adding some helper structure.

Most of the time, translators will only deal with the last two steps (setting up and linking the translation).

You can see an overview of the relevant structure of a page, and a full finished example towards the end of this page.

Setting up the source page

We'll assume that you want to translate a page that is maintained by the OLPC team; meaning that it will have a reference to the {{OLPC}} template—that groups pages in the Category:Pages maintained by OLPC—and they frequently are the entry points or that contain information that may be more obviously helpful for the local communities.

If the page to translate already has a language bar, you can skip down to #Modifying the language bar.

[[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 your 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 a #REDIRECT in the native language to your translated version.

Modifying the language bar

Below is an example of a typical language bar. The page that may need translation would have a link shown as +/- to the far right of the bar. (Not shown on this example.) This is a link to the editing page for the language bar. To create a link, for example when adding a new language on the language bar, follow this +/- link to go to the editing page. Then add the appropriate code for the new language.

   english | Copy "{{subst:requesttranslation}}" to DeutschCopy "{{subst:requesttranslation}}" to españolCopy "{{subst:requesttranslation}}" to 日本語 HowTo [ID# 78779] 

When inserting the link to your page, please keep things in alphabetical order denoted by the /lang-xx sequence (if you're adding say /lang-de it should go before the link to 'english'). Also, note the spaces around the '|' that separate each language. See above on /translations for more info.

Setting up the translated page

Although the translator is given as much freedom to edit and to translate as possible when translating the wiki, there is one rule that must be adhered to at all times. The translated page must be declared as a {{Translation}}. (Please note the use of "singular". Plural is for the original page and it will have many translations.)

There are couple of other bits of advice that may improve the quality of the translation process. First, please keep navigation and linking within the translated pages simple and easy to follow. Secondly, preserving the original text in the translation may simplify peer review and help with maintenance.

The quickest way to set up a page is by going back to the original page, then copying the wiki-text. This can be done either by following the edit link or through view source if the page is protected. Then copy the whole page and paste it onto 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, without any further segmentation—ie: instead of lang-pt-BR (brazilian portuguese), just lang-pt (portuguese)—just to keep things simple and neutral.

Adding the Ongoing 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}}
{{Ongoing Translation}}

== Some header ==

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

The main purpose of the {{Ongoing Translation}} template is to inform the readers that a particular page is still not finished, therefore they can expect the presence of untranslated text or that it hasn't been reviewed enough and thus may not be quite done yet. Parallel to that notice to the reader, it does a grouping of them in the Ongoing Translation category thus allowing other translators to find them and collaborate, review, make comments, etc. on them.

Translating section headers

When translating section headers, the best practice is to preserve them as anchors. Then add the translated text under it.

For example if the section header is called "Some Section Header" and it is translated into German in the form of "Einige Paragraph Kopfzeile". Original text "Some Section Header" is preserved by wrapping it between curly braces like the following:

   {{anchor|Some Section Header}}

Then the translated text "Einige Paragraph Kopfzeile" is placed under it. Together it will look like the following when finished:

    {{anchor|Some Section Header}} 
== Einige Paragraph Kopfzeile ==
[[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}}
{{Ongoing Translation}}

{{anchor|Some header}}
== Un titular ==

Some text blah... 
blah... [[#Another header]]
... blah {{anchor|Another header}} == Otro titular == Some other text blah...
blah... [[Another page]]
and [[Another page#section|section]]
... blah

Translating links

When translating links, the original text is preserved by using what is called "piped links". By placing the symbol "|" between original text and the translated text, both become connected together through a pipe. For example if "some-link" is to be translated into German as "einige-link", it will end up looking like the following:

   [[some-link|einige-link]]

As a result, following "einige-like" will be piped through to "some-link". To the reader the link will appear in translated form "einige-link".

Linking to a page in particular language

When linking to a translated page in a particular language use the /lang-xx to point to that particular translation.

   [[some-link/lang-de|einige-link]]

Translating texts

When translating text, it is useful to preserve original text by wrapping them inside {{Translated text}} function. "display = value" parameter can be used to control whether the original text is visible to the reader or not.

Original text invisible to reader (display = none).

   
    {{ Translated text |   
           original text
           more original text
           yet more original text
           final original text
       | display = none }}
    


Original text visible to reader (display = block).

   
    {{ Translated text |
           original text
           more original text
           yet more original text
           final original text     
       | display = block }}
    

Please see here for more information.


[[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}}
{{Ongoing Translation}}

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


Handling missing translated links

At the beginning, any link you 'translate' will most likely point to a non-existing page, don't worry. There are two alternatives:

  • let the wiki handle them through Special:Wantedpages
  • make one last translating effort: dedicated redirects

The first alternative is the simplest but also the hardest on the reader (lands them on the 'create page option' which is hardly the best alternative). Another downside, is that it'll be hard to detect those 'wanted pages' for a specific language, as they will be in the same list as all other 'missing translated pages' in other languages plus all the naturally missing pages in the wiki (a long list due to historical reasons).

The second, recommended alternative, is to create a redirect of the [[Foo/lang-xx]] to just [[Foo]] and categorizing the redirect in a dedicated category specific to the language:

[[Another page/lang-xx]]
#REDIRECT [[Another page]]
[[Category:Translations wanted lang-xx]]
WARNING
Make sure that the original page is not linking to a REDIRECT. If that is the case, you should change the target to the real page and create there the /lang-xx subpage. For example, if the [[Foo]] actually is a redirect to [[Bar]], then you should create the [[Bar/lang-xx]] instead of [[Foo/lang-xx]] and change the referencing link accordingly.

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 find out how many references to the missing page exist, giving some sense of need for it and thus guiding the translating efforts.

Please do NOT add these fake translation redirects to the /translations page, as it doesn't make sense to advertise a translation that doesn't yet exist. Only when the REDIRECT is made into a real translation (ongoing or otherwise) add the link to the language navigation page.

Full example of a wiki-page

Anatomy of a wiki-page

This 'sample' page includes all of the elements that require some level of consideration when translating
[[Original page]] Notes on the structure
{{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

== Some header ==
section headers act as anchors, and their translation is sensitive as they anchor incomming links.
[[#Another header]]
intra-page section linking may be simple to maintain as it's within the same page (you can search&replace local references) but will break external inbound links if changed.
[[Another page]]
the most common problem with links to other pages is to know how the page title has been translated...
[[Another page#section|section]]
links to specific sections in other pages pose the conflated problem of knowing both the target page name and the section name's translations.

Full finished example

[[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}}
{{Ongoing Translation}}

{{anchor|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}} {{anchor|Another header}} == Otro titular == Algo más de texto bla...
bla... [[Another page/lang-xx|Otra página]]
y [[Another page/lang-xx#section|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}}

{{anchor|Some header}}
== Un titular ==

Algo de texto bla... 
bla... [[#Another header|Otro titular]]
... blah {{anchor|Another header}} == Otro titular == Algo más de texto bla...
bla... [[Another page/lang-xx|Otra página]]
y [[Another page/lang-xx#section|sección]]
... bla

Supporting pages:

[[Original page/translations]]
[[Original page|english]] | [[Original page/lang-xx|shortNativeName]]
[[Another page/lang-xx]] [[Another page]]
#REDIRECT [[Another page]]
[[Category:Missing translation]]
some untranslated page...
maybe the content is mutating rapidly,
or is peripheric to the main corpus, etc.

Notes

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

Translation template notes

For the full documentation, please see Template:Translation.

lang
This parameter identifies the target language of the translation. See ISO 639 for a select list of codes being used in the wiki. (Another source is IANA's lang codes).
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).

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# yyyyy].
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—admitedly, they are very similar.

Translated text template notes

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!