[Zope] language tracking (again)

Pattreeya Tanisaro pattreeya@lightwerk.com
Mon, 12 Mar 2001 17:10:18 +0100


Hello all,
 
I  wonder what should I do if  I want to display the menu with the defaut is 
deusch and when the user clicks 
'english' the menu_left and menu_header swich to english. I have tried with 
this but it did not work  : ~( The code is below.

my standard_html_header :
 
<html>
<dtml-if expr="lang=='en'">
 <dtml-call "REQUEST.set('LANG', 'en')"> 
<dtml-else>
 <dtml-call "REQUEST.set('LANG', 'de')">
</dtml-if>
<head>
....
</head>
<body>
<dtml-if expr="lang=='en'">
  menu is english.
<dtml-else>
 menu is deutsch
</dtml-if>

#call menu_left
<dtml-var menu_left>

Inside menu_left, i wrote :
 
<dtml-if expr="lang=='en'">
  <a href="<dtml-var homeUrl>index_html?lang=de">Deutsch</a>
  English English English...
<dtml-else>
 <a href="<dtml-var homeUrl>index_e_html?lang=en">English</a>
  Deutsch deutsch...
</dtml-if>

my problem was i cannot switch to english ...but if i used en/de as boolean 
flag, it was fine. (But i guessed that did not make sense...?) I don't 
understand when I should put '-'(single quote) or ignore it. I saw from some 
examples that they used '-' to string within 'expr='. 
         And i wonder if I should put <dtml-call REQUEST.set ('LANG', 'en') 
or 
<dtml-call RESPONSE.setCookie(LANG, en) > to keep tracking language.
Some of us suggest using session but mm..it seems too difficult for a 
beginner, I think.?
         

                            Thank you in advance for any suggestion.

                                              
                                                Pattreeya.