[pmwiki-users] switch language
Stephan Schildberg
schildberg at scoid.de
Fri Apr 14 08:26:06 CDT 2006
> I woud like to have a Language switch link [english] [german], so the
> user could switch form german to englisch and back. The selection sould
> be storey in a cookie. So that it remembers the users desition.
> Basicly I would like to enable/disable the XLPage('de'..... entrys in
> the config-php file.
>
first: install cookbook - file:
http://www.pmwiki.org/wiki/Cookbook/MultiLanguage
the wiki-page will look like this:
(:if userlang de:)
blahblahblah
(:if userlang en:)
blahblahblah
(:if:)
to your template xxx.tmpl goes:
<div id='language'>
<!-- LP: Multiligue -->
<a href='?userlang=de title='*deutsch*'>*Deutsch*</a> | <a
href='?userlang=en' title='english'>English</a>
<!-- LP: Multiligue -->
</div>
you have to adjust <div id='language'> via css
to your config.php you add the following lines:
$DefaultLanguage = 'de';
$EnableMultiLanguage = 1;
include_once("cookbook/multilanguage.php");
if ($GLOBALS['userlang']=='de') {
XLPage('de','PmWikiDe.XLPageExtra');
XLPage('de','PmWikiDe.XLPage');
}
if ($GLOBALS['userlang']=='en') {
XLPage('en','PmWikiEn.XLPageExtra');
XLPage('en','PmWikiEn.XLPage');
}
regards, Stephan.
More information about the pmwiki-users
mailing list