Fwd: Re: [Pmwiki-users] Re: MulitLanguage

Knut Alboldt pmwiki
Fri Nov 12 09:17:32 CST 2004


Patrick R. Michaud wrote:
> On Sun, Nov 07, 2004 at 11:13:48PM +0100, Knut Alboldt wrote:
> 
>>to use it switchable I suggest using $userlang instead of 'de'  and 
>>PmwikiXx instead of PmWikiDe (so either for this you translate the first 
>>char of $userlang into uppercase or implement a conditional setting like
>>
>>if ($userlang=="de")  {
>>  XLPage('de','PmWikiDe.XLPage');       # from i18n.tgz
>>  XLPage('de','PmWikiDe.XLPageLocal');  # my local translations
>>}
>>elseif ($userlang=="fr")  {
>>  XLPage('fr','PmWikiFr.XLPage');       # from i18n.tgz
>>  XLPage('fr','PmWikiFr.XLPageLocal');  # my local translations
>>}
>># default will be en ?
> 
> 
> It also might be a good idea to use an array:
> 
> $langs = array('de' => 'PmWikiDe', 'fr' => 'PmWikiFr');
> if (@$langs[$userlang]) {
>    XLPage($userlang,$langs[$userlang].'.XLPage');
>    XLPage($userlang,$langs[$userlang].'.XLPageLocal');
> }

oh, I can say simply: nice and elegant (as all in pmwiki).

Thanks. I'll put that stuff together on the cookbook-page

Knut



More information about the pmwiki-users mailing list