Master pages, master lang, translation relationship

Introduction

In Wiclear, one thing I wanted to do is to have the possibility to translate a page in another language.

I hear you say what ? you can already do it with any wiki software by creating a page, say MyPage, and call it differently for the translations. Like FR_MyPage and ES_MyPage and DE_MyPage.

Right, you can do it. But what if a new user comes in and do not know this convention ? What if a page is updated : how can you easily know which page need to be retranslated ? In fact the problem is there is no real link between a master content (the page that was written first in a particular language) and the translations ...

Creating the link

As a wiki is primarily in a particular language (in the language of the admin, most of the time), and can then be translated in other languages, I started with those hypothesis :

The master lang is choosen during the install and can later be modified in the admin panel. This is the lang that appears in red in the langs section in the admin panel.

As a result of those hypothesis, a slave page cannot be created first : it can only be created after a master page has been created.

That explains why the "Add content" link creates a page only in the master lang.

Parent relationship

 CREATE TABLE {prefix}content_lang
 (
   related_content_fk      int(6),
   content_fk              int(6)
 );
 

A master page is related to itself, so related_content_fk = content_fk.

A slave page is related to a master page. related_content_fk points to a master page, content_fk points to the slave page.

Hierarchy and master pages

Only master pages get an entry in the hierarchy table.

Slave page are related to a master page, so this is the master page they are related to that gives them their place in the hierarchy.


Generated on Mon Feb 19 19:11:58 2007 for Wiclear by  doxygen 1.4.7