Wiki source for DocumentationLanguageLinking


Show raw source

=====Linking to documentation-pages in other languages=====

Since we have more then one language now, we should think about the necessary links between the pages.

My thought was something like http://www.openformats.org, i.e. you have a list of other languages shown somewhere in the page.

My solution would be an action, like ""otherlanguages"" which you would insert into a page only once and which would display the links to the other pages.

Comments?

~& Why not, but to do this we first need a //clean// server (possibly with limited ACL access to users willing to participate in the documentation project) and a strict respect of the naming conventions. I suggest we postpone this after the setup of a dedicated documentation server, like - say - ##wikkadocs.jsnx.com## (any suggestions for a better name). JsnX, you think this is feasible ? -- DarTar
~~&Are you asking if it is feasible to have a new subdomain named something like ##wikkadocs.jsnx.com##? Sure. By the way, I'm deferring to you, Nils, JW and others on multilanguage decisions. Just tell me what you need for resources and I'll make it happen. -- JsnX
~~&##documentation.jsnx.com## ? Yes, maybe it's better to wait with this, but why not collect some ideas? --NilsLindenberg
~~&After viewing OF system, it seems good to me. As Nils says, links to other languages (already translated and __not__-translated) would be good. I'm not very constructive atm, but I'll try to think about it and give a small idea about approaching this. -- PivWan


----
==The 'quick and dirty' openformats approach==

[[http://www.openformats.org Openformats.org]] adopts alphanumeric tags for identifying nodes and their language: for instance **en**, **fr**, **it**, *es**, are the top level nodes in English, French, Italian and Spanish; **en0** is the first subnode of the English version, **it20** is the first subsubnode of the third subnode of the Italian version etc.
There are also a bunch of pages whose tags are camelcase-formatted, but they follow the same convention: **enLinking** is the English altlang of **frLinking** etc.

I post here for reference the modifications I made to Wikka at openformats to support //horizontal links between corresponding pages in different languages// (in ""ODPian"" jargon they are called //altlangs//). This is definitely **not** a suggestion for an action to implement on this server (the code is dirty and tailored to the conventions in use at OF), but just a possible source of inspiration.

**1. Store language definitions in your wiki**
Create an ordinary page called ##Languages## containing language names and their code:

%%
de Deutsch
en English
fr Français
it Italiano
mg Malagasy
%%

**2. Create the action to automatically build altlangs **
Add the ##lang.php## action to ##./actions##:

%%(php;1)
<?php
//get current page
$cpage = $this->GetPageTag();
$ctag = substr($cpage, 0, 2); #extract tag
$cnode = substr($cpage, 2); #extract node
if ($cpage=="main") {
$ctag = "en";
$cnode = "";
}

$page = $this->LoadPage('Languages');
$output = $this->Format($page["body"]);
$couples = explode("\n" , $output);
if (ereg("[A-Z](.*)", $ctag)) { #all public pages in openformats start with a lowercase letter
// page is not public
// display default menu bar
foreach ($couples as $language) {
$l = explode(" " , $language);
$tag = strip_tags($l[0]);
$lang = strip_tags($l[1]);
print $this->Format("[[".$tag." ".$lang."]]")." ";
}
} else {
// page is public
// display navigation menu
foreach ($couples as $language) {
$l = explode(" " , $language);
$tag = strip_tags($l[0]);
$lang = strip_tags($l[1]);
if ($tag == $ctag) {
print $this->Format("**".$lang."**")." ";
} else {
print $this->Format("[[".$tag.$cnode." ".$lang."]]")." ";
}
}
}
?>

%%

**3. Modify the ##header## action**

Add the following code to ##./actions/header.php## at the end of the code, immediately after the closing ##</div>##:

%%(php)
<div class="lang">
<?php
include("lang.php");
?>
</div>
%%
-----
=====MAIN PAGE LANGUAGES=====
* SpanishLanguage
* FrenchLanguage


----
CategoryDevelopmentDocumentation CategoryDevelopmentActions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki