[pmwiki-users] switch language

noskule noskule at gmx.net
Sat Apr 15 11:52:52 CDT 2006


noskule schrieb:

>Stephan Schildberg schrieb:
>
>  
>
>>>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.
>>
>>
>>    
>>
>hm, ist seams that if got a problem. I used:
>
>if ($userlang == 'XX') {
>    XLPage('XX','PmWikiXX.XLPageCookbook');
>    XLPage('XX','PmWikiXX.XLPage');
>    }
>This seams to work, but only if the url has the extension ?userlang=de. 
>It seams that rather than to ask for the userlang variable I have to ask 
>vor the value in the cookie. Is this correct? And if how would I do that?
>Do you have any suggestions?
>grz nos
>
>
>
>  
>
oky, I found out that its only work if there is a auserlang statement in 
the page.

         (:if userlang de:)
could I change that, so that it allways work. Cause it is also possible 
to translate pages via translation page
        'English Page' => 'German Page'

Do you have any suggestions?
See example: 
http://test.netstreams.org/index.php?n=NetstreamsSkin.SandBox (Change 
betwean SandBox 1 2 3)

>>    
>>
>
>
>_______________________________________________
>pmwiki-users mailing list
>pmwiki-users at pmichaud.com
>http://host.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
>  
>





More information about the pmwiki-users mailing list