[Zope] Multiple Languages
Dan Rusch
drusch@globalcrossing.com
Thu, 29 Jun 2000 10:19:45 -0500
I posted a similar question here a few days ago, subject line
Internationalization. The responses were less than overwhelming and
although I greatly appreciated the suggestions from the people who did
respond it was quite apparent that the problem of multilingual sites has
not been solved gracefully yet.
The best idea we came up with so far, which was also one of the
suggestions, is to either let the user select a language or more
preferably examine the HTTP_ACCEPT_LANGUAGE variable in the REQUEST
space.
based on it's setting we change a property of the top level folder:
<dtml-if "REQUEST['HTTP_ACCEPT_LANGUAGE'][:2]=='it'">
<dtml-call
"top.manage_changeProperties(LANG_PATH='/top/Italian/ActualPages/')">
<dtml-else>
<dtml-call
"top.manage_changeProperties(LANG_PATH='/top/English/ActualPages/')">
</dtml-if>
which as you can see adjusts the acquisition path to traverse through a
language specific folder.
Next on each page instead of text we use dtml methods that hold text:
<dtml-var standard_html_header>
<h2><dtml-var title_or_id></h2>
<p><dtml-var someText> <dtml-var id> <dtml-var moreText>.</p>
<form action="thisForm">
<input type=submit>
</form>
<dtml-var standard_html_footer>
Notice there isn't any plain text on the page, but that the text to be
render is in the variables someText and moreText. I would suggest using
variable names that are made up from the text to be displayed (in the
native language of the developer). For example say the text to be
displayed is: "Customer Contact Information" the variable name maybe
<dtml-var tCustContactInfo>. Prepending the 't' tells me that this is a
text holder.
Lastly in the folder English and Italian, in this example, we have
placed dtml methods someText and moreText with the appropriate
translations in them.
The correct language is rendered automagically based on the user
choice....
we preferred this to the alternative of placing the translations in the
page because to add another language, say German, when the translations
are on each page ,would require touching every page in the site. since
we have close to a thousand pages, we found this to be unacceptable. In
the system I have outlined above all that would be required would be to
copy the english folder to a german folder and translate each method
into german and poof you have added another language....
hope this helps ,
DR
Christian Zagrodnick wrote:
> Tino Wildenhain wrote:
> > Christian Zagrodnick wrote:
> > >
> > > has anybody figured out how to make a zope website multilingual?
> > >
> > > I have to make a website in German and English -
> > > but the database stuff etc. is all the same.
> > >
> > > Did anybody do that?
> > somewhat. I have the code to tell what version of the page is
> > appropriate
> > with given browser-configuration (language-preferences) and
> > availability.
> > We have now to make a product to hold the different versions of
> > documents
> > for each language.
> This would be a solution...
> The problem is to split the design/program from the content I think.
> AFAIK xml supports multiple languages in one file - perhaps we should
> think about this....
>
> --
> Christian Zagrodnick - Progressive Media Production
> http://www.promp.de/
>
> Die Haftung ist auf das Gesellschaftsvermoegen beschraenkt.
>
> _______________________________________________
> 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 )