[Pmwiki-users] Wikis with multiple languages

Dr. Rainer Decker privat rainer
Mon Jan 12 08:40:55 CST 2004


Hi Patrick,

comparing your 'brainstorming suggestions' I would clearly
vote for alternative 3. (conditional markup) - because this
feature would not provide a clean solution for the processing
of "multilanguage files", but could also be helpful in a  
lot of other cases. 
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]]

(if possible, nesting should be permitted....)

Examples:
- put comments into Wiki files ("[[if false]] <comment> [[endif]]")
- display a WikiWord like "Edit" depending on the rights
    of the user
- date dependent stuff as you use in your example
- time dependent text , e.g.
      [[if  (hour<12) ]]
       Good morning!
      [[endif ]]
and so on.

kregs - rd
 



----- Original Message ----- 
From: "Patrick R. Michaud" <pmichaud at pobox.com>
To: "Eike Decker" <eike at cube3d.de>
Cc: <Pmwiki-users at pmichaud.com>
Sent: Monday, January 12, 2004 3:39 AM
Subject: Re: [Pmwiki-users] Wikis with multiple languages


> At the moment I don't have many ideas about how to effectively
> implement what you're looking for, but here are a few quick thoughts 
> about some of it...
> 
> Instead of using five dollar signs as the markup (e.g., '$$$$$de'), I'd
> use "=lang de" or something equivalent.  And instead of explicitly
> saying '$$$$$default', I'd use just '=lang' with no language specifier
> to indicate parts that are always shown (or, if you're sticking with the 
> dollar signs, just five dollar signs with no language modifier following
> them).
> 
> It's probably not possible to do what you want simply using the $DoubleBrackets
> and $InlineReplacements arrays described previously; it'd probably have to
> go into $BrowseDirectives, and the processing of $BrowseDirectives currently
> doesn't support this.  Alternately you could put a wrapper function around
> the call to PrintText from $HandleBrowseFmt that does the language 
> preprocessing you want.  This is the most likely approach.
> 
> Some other ideas (probably not what you're looking for but I'm just
> brainstorming here...):
> 
> 1.  Maintain the pages in separate groups, but modify the Edit form so 
> that each language version appears on the same page in its own
> edit box.  This would help to maintain consistency between versions.
> However, I'm guessing that you're wanting the pages to have some sections
> of language-specific text and other sections of shared text, so this doesn't
> work exactly right either.
> 
> 2.  Instead of trying to figure out what happens upon displaying the 
> text, process it at the time of posting the text.  You could have a 
> master edit page with the =lang sections, but when it's posted the 
> post routine handles the various language-specific portions
> and saves each in the appropriate language group.
> 
> 3.  There's currently a proposal for a "conditional markup" feature
> where sections of markup text in a page can be included or excluded 
> based on a variety of conditions, see 
> http://www.pmichaud.com/wiki/Development/ConditionalMarkup .  
> It wouldn't be hard to include "language settings" in such a feature--
> i.e., to include or exclude text based on a language settings.
> However, this feature has received very few votes on
> http://www.pmichaud.com/wiki/Development/DevelopmentPriority so
> I haven't given it much thought at the moment.
> 
> -----
> 
> One last note:  Even if it can't be easily implemented at this time,
> this request really helps me guide PmWiki development because it points
> out areas where the current document handling is a bit weak, and I can
> start to tweak PmWiki's internals to be able to handle such things much
> easier.  So, even if we can't get it to work in the current version, I
> may be able to change things around in 0.6 or 0.7 to be able to support
> this sort of thing in the future.
> 
> Pm
> 
> 
> On Sun, Jan 11, 2004 at 10:49:16PM +0100, Eike Decker wrote:
> > Hi
> > 
> > Introduction: 
> > I have set up a couple of PMwikis till today and most of them had the
> > requirement to support multiple language - the visitor should be able to switch
> > the displayed language of the whole page. There were only two solutions for me
> > and I tried both: One is to set up different groups for the different languages
> > by appending the language letters (de / fr / en ... ), but with exactly the
> > same
> > pagenames to switch without problems between the languages. The other way is,
> > to
> > include all wanted languages in a single wikipage with a special syntax. 
> > Both methods have advances and disadvantages. For me, I prefer to include the
> > languages in one file since it is much easier to maintain because everything is
> > kept close together. On the other hand, it looks more ugly to for the user if
> > he
> > edits the page. 
> > However, this feature is one of the most wanted wishes by the people I am
> > working for (normally they want to present their pages in their own language
> > and in english).
> > 
> > So I would like to discuss about this feature, since I have to use a special
> > syntax and I am not an advanced PHP programmer.
> > As said before, I would prefer to include all the languages in one file -
> > currently I do this by using a syntax like the divider (----): 5 dollars plus
> > the language code mark the following lines as the chosen language in a single
> > line - for example
> > '$$$$$de' choses german, '$$$$$en' english and '$$$$$default' marks parts that
> > are always shown. 
> > The problem for me was to enable this kind of feature - I only managed to do
> > this by modifying the printtext() function which is currently cutting the
> > unwanted language parts simply away (additionally it stores the available
> > languages in a variable to chose one of them). But I guess that should be also
> > possible by using the
> > regex functions provided by you (maybe you can give me a hint ;)).
> > Last but not least the wiki has to remember the chosen language and thatfor
> > I've
> > chosen the phpsessions.
> > 
> > So my first problem here is: Is the syntax well chosen or not?
> > And the second problem is: Can you give me a hint to implement this a little
> > bit
> > better (completly in an external php file)?
> > And is there a way to connect all this with the internationalizations from the
> > cookbook? Currently the pmwiki documents are seperatly translated into groups
> > with the language strings appended (PmWikiDe / PmWikiFr ...). So there's a
> > little contradiction to my prefferred model...
> > 
> > So what do you think about all this?
> > 
> > best regards
> > Eike Decker
> > 
> > --
> > Pmwiki-users mailing list
> > Pmwiki-users at pmichaud.com
> > http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 
> --
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 



More information about the pmwiki-users mailing list