[Pmwiki-users] Re: MulitLanguage

Knut Alboldt pmwiki
Sun Nov 7 12:23:04 CST 2004


At 15:10 07.11.2004, Knut wrote:
>At 13:11 07.11.2004, Raul wrote:
>>Knut Alboldt wrote:
>>>At 16:03 06.11.2004, you wrote:
>>>to 1)
>>>if you're using pmwiki v2, you could do this by using the if-markup. You 
>>>have to define a IF-condition that matches the user's language (could be 
>>>either set by url-parameter and or cookie e.g. lang=fr or maybe by some 
>>>information you can get from the browser (have to look for some 
>>>browser's var passed to the server)). Then you can compose your page like that:
>>>(:if userlang en)
>>>here goes the english text
>>>(:if userlang fr:)
>>>here goes frensh text
>>>(:if userlang de:)
>>>here goes german text
>>>(:if:)
>>
>>I just tried this and added "&userlang=de" to the URL but it still shows 
>>both languages (if-clauses)
>>http://wiki.graphity.info/pmwiki.php?pagename=M%FCnchen.Universit%E4tenVergleich&userlang=de
>>
>>Any ideas?
>
>yes, the condition has to be defined in config.php
>well just as a quick idea something like that (not the real code):
>
>if (isset($_REQUEST['userlang'])) /* or check $_GET['userlang']
>   { $userlang = $_REQUEST['userlang']; }
>else
>   { $userlang = 'en'; /* or get if from 
> $_SERVER['something-like-browser-language']; }
>
>   $Conditions['userlang'] = '$GLOBALS["userlang"]==$condparm';

I set up a (quick and dirty) cookbook-entry: 
http://www.pmwiki.org/pmwiki2/pmwiki.php/Cookbook/MultiLanguage
please have a look and test it. It could be improved (will do this in the 
next week).
Any feedback would be good.

-Knut




More information about the pmwiki-users mailing list