[Zope] Acquisition for bilingual site

Stephan Goeldi stephan.goeldi@datacomm.ch
Thu, 28 Mar 2002 07:49:07


Acquisition trouble

I am setting up a bilingual website (english/german). I followed the 
instructions in

http://www.zope.org/Members/Hoekstra/ChangingZopeContexts

which I modified a little, because I don't have more than 2 languages on 
this site. I created the following structure:

/
   navigation
   standard_html_header
   standard_html_footer
   index_html
   de/
      content
      about/
      order/
      ...
   en/
      content
      about/
      order/
      ...
   home/
      index_html

The logic is this:

By entering the website, /home/index_html is called.
It looks at the browser language and decides, whether it is german (->de) or 
anything else (->en).
This is /home/index_html:

---------- /home/index_html ----------
<dtml-var standard_html_header>
  <dtml-if "REQUEST.HTTP_ACCEPT_LANGUAGE=='de'">
    <dtml-var de>
  <dtml-else>
    <dtml-var en>
  </dtml-if>
<dtml-var standard_html_footer>
----------------------------------------

So this should point at /en, if the browser language is different than 
german (language selection works perfect in this case). The content of /de 
are some subfolders without an index_html, so the index_html of / should be 
used. This is /index_html:

---------- /index_html ----------
<dtml-var standard_html_header>
<dtml-var navigation>
  <dtml-if content>
    <dtml-var content>
  </dtml-if>
<dtml-var standard_html_footer>
----------------------------------------

---------- /navigation ----------
<a href="<dtml-var about>">about</a> |
<a href="<dtml-var performance>">performance</a> |
<a href="<dtml-var security>">security</a> |
<a href="<dtml-var prices>">prices</a> |
<a href="<dtml-var support>">support</a> |
<a href="<dtml-var order>">order</a> |
<a href="/en/"><dtml-var english></a> | -->icon
<a href="/de/"><dtml-var deutsch></a> | -->icon
----------------------------------------

So if the browser language is detected, and points to /de or /en, 
/index_html should be used, to display an object called 'content' (if it 
exists) and the /navigation object should be included. If the user decides 
to select another language, he/she can click on the appropriate language 
link (de/en). On this level, the browser language detection should no more 
be active.

But what I get is this traceback, which seems to originate from /navigation:

Traceback (innermost last):
  File C:\ZOPE\lib\python\ZPublisher\Publish.py, line 150, in publish_module
  File C:\ZOPE\lib\python\ZPublisher\Publish.py, line 114, in publish
  File C:\ZOPE\lib\python\Zope\__init__.py, line 158, in 
zpublisher_exception_hook
    (Object: zopehosting)
  File C:\ZOPE\lib\python\ZPublisher\Publish.py, line 98, in publish
  File C:\ZOPE\lib\python\ZPublisher\mapply.py, line 88, in mapply
    (Object: index_html)
  File C:\ZOPE\lib\python\ZPublisher\Publish.py, line 39, in call_object
    (Object: index_html)
  File C:\ZOPE\lib\python\OFS\DTMLMethod.py, line 127, in __call__
    (Object: index_html)
  File C:\ZOPE\lib\python\DocumentTemplate\DT_String.py, line 473, in 
__call__
    (Object: index_html)
  File C:\ZOPE\lib\python\OFS\DTMLMethod.py, line 120, in __call__
    (Object: standard_html_header)
  File C:\ZOPE\lib\python\DocumentTemplate\DT_String.py, line 473, in 
__call__
    (Object: standard_html_header)
  File C:\ZOPE\lib\python\OFS\DTMLMethod.py, line 120, in __call__
    (Object: navigation)
  File C:\ZOPE\lib\python\DocumentTemplate\DT_String.py, line 473, in 
__call__
    (Object: navigation)
KeyError: about

So there seems to be a problem with the first called navigation object 
(about). This is a subdirectory of /de and /en. What did I miss?









_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com