Author Topic: HOW-TO: Translating the PCLinuxOS Wiki  (Read 2197 times)

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
HOW-TO: Translating the PCLinuxOS Wiki
« on: September 07, 2009, 08:01:31 PM »
Translating the PCLinuxOS Wiki

This is a how-to I put together when trying to help Melodie & others with their requests to set up the wiki for translation into additional languages.  It was originally posted on mypclinuxos, but as there seems to be some great translation work going on here it seemed appropriate to share it with any of you that may not visit that site.  Please feel welcome to create an account on the wiki and contribute translations and original content as you see appropriate!


NOTE: The main wiki page is a little more complicated than most because it is made up of a series of templates inside of templates, inside of templates..  because of this, the translation of this one page will actually require translations of multiple pages.  If you need any assistance in setting up pages for translation, PM me and I will be happy to get things set up for you.

(1)  Create the template containing the links to the pages that will be the translated versions of English language page:

Enter the following into the search / go form in the left margin of the wiki and click go (replace 'page name' as needed):
Quote
Template:page name i18n links


..if the template does not exist you will be given the option to create it.  The page should contain the following wiki code (again, replace 'page name' as needed):
<div style="padding: 0; margin: 0; text-align: center;">
i18n Translations:
[[page name (Česky)|cs]]
[[page name (Dansk)|da]]
[[page name (Deutsch)|de]]
[[page name (Ελληνικά) |el-GR]]
[[page name |en]]
[[page name (Español)|es]]
[[page name (Français)|fr]]
[[page name (Italiano)|it]]
[[page name (日本語)|ja]]
[[page name (%ED%95%9C%EA%B5%AD%EC%96%B4)|ko]]
[[page name (Lietuviškai)|lt]]
[[page name (Nederlands)|nl]]
[[page name (Polski)|pl]]
[[page name (Português do Brasil)|pt-BR]]
[[page name (Português)|pt-PT]]
[[page name (Русский)|ru]]
[[page name (Slovensky)|sk]]
[[page name (ไทย)|th]]
[[page name (Türkçe)|tr]]
[[page name (Українська)|uk]]
[[page name (简体中文)|zh-CN]]
[[page name (繁體中文)|zh-TW]]
</div>


..next we need to embed the localization links template we just created into the original English language wiki page;  later we will use these embedded links to create the new pages that can contain translations of the original (which also need to have the translation links template included).



(2) Embedding the translation links template into a wiki page:

Typically, embedding templates into a wiki page is as simple as putting the template name inside a double pair of curly braces.  For example, if the template was created with the name Template:page name i18n links as suggested above, then we could embed that wiki template / page into another wiki page with the following wiki code:
Quote
{{page name i18n links}}


In order to make the translation links visually distinguished and separate, I am going to suggest that we make it just slightly more complicated by putting the translation links template inside of another template that I created especially for this purpose (it surrounds the links in a box that will span the page).  Here is the wiki code that should be placed at the top of the english wiki page and all of its translations (again, replace page name as needed):

Quote
<!-- ============================================= -->
{{Home/section-no_title
|content = page name i18n links
}}
<!-- ============================================= -->


..now that we have the code, go ahead and add it to the top of the wiki page that you are going to translate.  Once it is there, click "Save" at the bottom of the page and you should see the i18n translation links at the top of the page in a box spanning the top of the page.  Next on to the translations..



(3) Creating the translated page:

Creating the translated page should be as simple as clicking on the translation link at the top of the page that we just created.  If the translation does not exist you will be given the option to create it.  

I would recommend opening the link to create the page into a new tab, that way the original page is easily referenced while translation is in progress.  If you think the original formatting of the page is suitable to your translation, you may also want to click the edit button on the original english wiki page and copy all the wiki code to use as a basis for your translation; this will likely save you significant time by re-using the existing wiki formatting.

When finished, click save.  Try browsing to your translations beginning at the wiki home page; if all is done correctly you should be able to find your way to the new page in the comfort of your preferred (non-english) language.

 ;D ;D ;D


..I almost forgot..  there's more!  Translating Templates..

(4) Translating Templates

In the case of some pages (..for example the main wiki home page), the actual content of the page is made up of content from wiki Templates.  In this case, when you copy the wiki code of the original english language wiki page into the translated one you may see references to templates using one of the formats described in section (2) above.  

When you find these embedded wiki templates in a page, the easiest (and best) way to deal with them is to append the translated language name in parentheses to the end of the template name.  When the page is saved you will see links to these non-existing template translations; you can then click on the links to create those templates, and copy, paste, and translate as above in section (3).  For example, if the main wiki home page contains the following wiki code (excerpt):

Quote
<!-- ============================================= -->
{{Home/section-full_width
|title = Welcome
|content = Welcome
<noinclude>|link = [[Template:Welcome|Edit..]]</noinclude>
}}

<!-- =======Begin left column============= -->
{|width="100%" cellspacing="0" cellpadding="0" style="margin-top:0.6em"
|-
|style="padding:4px;font-size:1px"|&nbsp;
|style="font-size:0.6em;line-height:0.6em"|&nbsp;
|-
| valign="top"|
<!-- ============================================= -->
{{Home/section
|title = Common Task Portal
|content = Common_Task_Portal
<noinclude>|link = [[Template:Common Task Portal|Edit..]]</noinclude>
}}


..to create translations of all the embedded templates we simply add the language (francais in the followin example) to all of the |content = and associate |link = if they exist:
Quote

<!-- ============================================= -->
{{Home/section-full_width
|title = Welcome
|content = Welcome (Français)
<noinclude>|link = [[Template:Welcome (Français)|Edit..]]</noinclude>
}}

<!-- =======Begin left column============= -->
{|width="100%" cellspacing="0" cellpadding="0" style="margin-top:0.6em"
|-
|style="padding:4px;font-size:1px"|&nbsp;
|style="font-size:0.6em;line-height:0.6em"|&nbsp;
|-
| valign="top"|
<!-- ============================================= -->
{{Home/section
|title = Common Task Portal
|content = Common_Task_Portal_(Français)
<noinclude>|link = [[Template:Common Task Portal (Français)|Edit..]]</noinclude>
}}


..also remember that templates can be embedded using the double curly brace syntax {{template name}} which could be modified to {{template name  (Français)}}



..that should be enough to get people started..  if you have any difficulties, PM me with a link and a description and I will see what I can do.

 ;D

[attachment deleted by admin]
« Last Edit: September 18, 2009, 05:19:02 AM by travisn000 »

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: HOW-TO: Translating the PCLinuxOS Wiki
« Reply #1 on: November 05, 2009, 01:13:11 PM »
(reserved for more info..)

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: HOW-TO: Translating the PCLinuxOS Wiki
« Reply #2 on: November 05, 2009, 01:13:21 PM »
(reserved for more info..)