Revision history for DocumentationLanguageLinking
Revision [18654]
Last edited on 2008-01-28 00:12:18 by PedroM [Modified links pointing to docs server]No Differences
Additions:
-----
=====MAIN PAGE LANGUAGES=====
* SpanishLanguage
* FrenchLanguage
=====MAIN PAGE LANGUAGES=====
* SpanishLanguage
* FrenchLanguage
Additions:
[[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.
$l = explode(" " , $language);
$tag = strip_tags($l[0]);
$lang = strip_tags($l[1]);
print $this->Format("[[".$tag." ".$lang."]]")." ";
$l = explode(" " , $language);
$tag = strip_tags($l[0]);
$lang = strip_tags($l[1]);
print $this->Format("[[".$tag." ".$lang."]]")." ";
Deletions:
$l = explode(" " , $language);
$tag = strip_tags($l[0]);
$lang = strip_tags($l[1]);
print $this->Format("[[".$tag." ".$lang."]]")." ";
}
Additions:
CategoryDevelopmentDocumentation CategoryDevelopmentActions
Deletions:
Additions:
~~&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
Additions:
%%(php)
Additions:
==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** are the top level nodes in English, French and Italian; **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>##:
%%
<div class="lang">
<?php
include("lang.php");
?>
</div>
%%
[[http://www.openformats.org Openformats.org]] adopts alphanumeric tags for identifying nodes and their language: for instance **en**, **fr**, **it** are the top level nodes in English, French and Italian; **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>##:
%%
<div class="lang">
<?php
include("lang.php");
?>
</div>
%%
Additions:
~~#documentation.jsnx.com## ? Yes, maybe it's better to wait with this, but why not collect some ideas? --NilsLindenberg
Deletions:
Additions:
~& 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
~~#documentation.jsnx.com# ? MYes, maybe it's better to wait with this, but why not collect some ideas? --NilsLindenberg
~~#documentation.jsnx.com# ? MYes, maybe it's better to wait with this, but why not collect some ideas? --NilsLindenberg
Deletions:
Additions:
~~&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
Additions:
~& 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