[Zope] Could Someone Clean This DTML Up?
beno
zope@thewebsons.com
Wed, 08 Jan 2003 05:05:24 -0400
At 02:18 PM 1/6/2003 -0500, you wrote:
>[ beno]
> > Okay, well here's what I've got right now...
> >
> > <dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE')">
> > <dtml-in objectsInTheFolder>
> > <dtml-if id=="&dtml-lang;">
> > <dtml-let approved="&dtml-lang;">
> > <dtml-var approved>
> > </dtml-let>
> > <dtml-else>
> > <dtml-let approved="en">
> > <dtml-var approved>
> > </dtml-let>
> > </dtml-if>
> > </dtml-in>
> > </dtml-let>
> >
>
>Beno, start simple. You can get everything else working, then deal with
>objectsInTheFolder -
>
><dtml-let lang="REQUEST['HTTP_ACCEPT_LANGUAGE']">
> <dtml-in "[1,2,3]"> <!-- a simple array just for testing-->
> <dtml-if "id==lang">
> <dtml-var lang>
> <dtml-else>
> en
> </dtml-if>
> <br>
> </dtml-in>
></dtml-let>
>
>Bear in mind that "lang" is not going to be just "en" or whatever, and a
>basic "en' may occur in several variations. You will probably want to
>do some string processing on it before doing your comparison.
>
>I presume that you will want to call some function or script - you were
>talking about a redirect earlier. In that case, replace <dtml-var lang>
>with <dtml-call "your_script(lang)">,
> and replace "en" with something like <dtml-call "another_script("en"),
>or use dtml-var if you want something to be displayed on the page.
Well, actually, no. What I'm building is a product for people who are new
to Zope that want a quick, easy template for building "brochureware" sites,
one that will also serve as a tutorial. In such sites, the content rarely
changes and it isn't too much to deal with anyway. There are good Zope
products out there that do translation that people who need industrial
strength can use ;)
I got the folder thing taken care of ;)
Thanks,
beno