I just finished the multilingual website
http://www.ab-m.de for a customer of mine and wanted to share my solution for a multilanguage site:
I made a variant of the "Make Multi Lingual Site" How To found on
http://wiki.modxcms.com/index.php/Make_Multi_Lingual_Site.
First thing: my Document Tree looks like this (see attached image).
This way I can get the language by:
// getLang snippet
$ultimateParentID=$modx->runSnippet("UltimateParent");
$ultimateParent=$modx->getDocument($ultimateParentID);
return($ultimateParent["alias"]);
A language array is created by:
// print languages snippet
$langArray=$modx->getDocumentChildren(0);
foreach($langArray as $language)
{
$langHomeURL=$modx->makeUrl(intval($language["id"]));
echo('<a href="'.$langHomeURL.'">'.$language["pagetitle"].'</a>');
}
Navigation is build by:
[!Wayfinder? &startId=`[[UltimateParent]]`!]
Second thing: I made an summary of all relevant document IDs:
$home["de"]=1;
$home["en"]=32;
$context["de"]=11;
$context["en"]=53;
$metaTags["de"]=57;
$metaTags["en"]=56;
$metaNav["de"]=7;
$metaNav["en"]=49;
...
Setting this IDs allows me later on to get the desired documents without bothering what language is selected.
Examples:
$modx->setPlaceholder('homeURL', $modx->makeUrl(intval($home[$lang])));
...
$modx->setPlaceholder('aktuellesID', $aktuelles[$lang]);
...
or
[!Ditto? &tpl=`dittoAktuelles` &startID=`[+aktuellesID+]`!]
Of course there are a few more things to take care of so that the multi lingual site runs smoothly. But these are the most important steps.
I hope this helps you