[Pmwiki-users] Wikis with multiple languages

Dr. Rainer Decker privat rainer
Mon Jan 12 10:59:43 CST 2004


Hi Patrick,

your proposal is perfectly ok. 

The main purpose of my proposal was to  use ONE keyword 
("endif") instead of a whole lot of these ("endtime", "endtrue",
 .., i.e. one per initial keyword), which I understood was your 
proposal.

I agree that a complete parser is probably overkill, however
even if one day someone would feel tempted to write one, the 
syntax is already there.....

If you don't like the "[[else]]" - what's about another keyword,
e.g. [[ifnot xxxx]], which just does the opposite of the "if"? 

And a final question regarding the multilanguage issue (which is
the driving force behind this discussion): a statement  like
    [[if lang ]] 
or
    [[if lang default]]
would then be obsolete, as everything outside a "language
bracket pair" would be displayed regardless of the setting
of the lang parameter.

I think this solution is far superior to the "five-dollar" approach
that Eike used in his initial solution. 

Btw, Eike is my son, whom I'm pushing since half a year to 
program an easy-to-understand and easy-to-handle solution 
for our multilingual websites. Meanwhile he has produced 
three solutions, each one a little bit more sophisticated then
the ones before. 

Now I am really looking forward to the [[if ...]] based approach.

Thanks and
kregs - 
Rainer Decker





----- Original Message ----- 
From: "Patrick R. Michaud" <pmichaud at pobox.com>
To: "Dr. Rainer Decker (privat)" <rainer at dr-decker.de>
Cc: <Pmwiki-users at pmichaud.com>
Sent: Monday, January 12, 2004 5:15 PM
Subject: Re: [Pmwiki-users] Wikis with multiple languages


> On Mon, Jan 12, 2004 at 11:27:21AM +0100, Dr. Rainer Decker (privat) wrote:
> > Hi Patrick,
> > But if you do so, wouldn't it be easier to implement a more 
> > general syntax similar to the one used e.g. as conditional
> > directives in C-compilers:
> >     [[if  <condition or function>]]
> >          <stuff displayed for condition or function result 'true'>
> >     [[else]]
> >         <stuff displayed for condition or fucntion result 'false'>
> >     [[endif]]
> > [...]
> > - time dependent text , e.g.
> >       [[if  (hour<12) ]]
> >        Good morning!
> >       [[endif ]]
> > and so on.
> 
> Well, no, I really don't want to write a whole C-like conditional
> expression parser in PmWiki--that seems really overkill, plus the 
> syntax of C expressions may alienate many authors.  (Also, one has
> to be careful about protecting PHP variables from access/modification
> by wiki authors.)
> 
> As opposed to using C expressions, I might just use a flag
> or function based format...for example, all conditionals would
> be in the form
> 
>    [[if <test> <param>]]
>       <stuff>
>    [[endif]]
> 
> where <test> is selected from an array of possible tests (definable
> by the WikiAdministrator) and <param> is an optional string parameter 
> that can be passed to the test.  Example if statements could be...
> 
>    [[if lang en]]
>    [[if false]]
>    [[if printing]]
>    [[if daterange 20040110-20040117]]
> 
> where a WikiAdmin could define tests as:
> 
>    $Conditional['false'] = 0; 
>    $Conditional['printing'] = ($action=='print');        
>    $Conditional['lang'] = "$_SESSION['lang']=='$1'";    
>    $Conditional['daterange'] = "IsDateRange('$1')"; 
> 
> Pm
> 



More information about the pmwiki-users mailing list