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.
Hi Pattreeya, any good reason why not using the accept-language: header from the browser? Regards Tino Pattreeya Tanisaro wrote:
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.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Pattreeya Tanisaro -
Tino Wildenhain