[Zope] Internationalization

Dieter Maurer dieter@handshake.de
Tue, 20 Jun 2000 21:41:01 +0200 (CEST)


Dan Rusch writes:
 > We have a site that is composed of several hunderd pages. We don't use
 > classes but we have made heavy use of aquistion though. For example we
 > have one back button that is aquired thoughout the site etc etc.
 > Basically if the functionality (or code) is used in more than one place
 > it has been but into a method and aquired.
Aquisition should play well with internationalization.

You would put the localization into the aquired objects.

If the language information is e.g. in a cookie,
you could use its value to select the various language
variants of your object.
If the language information is in the URL, I probably would
extend the Zope folder class to a LangFolder.
It would behave exactly likes a normal folder, but would
add an "LANGUAGE" variable to the REQUEST object during
traversal.

To select the correct localization of an object,
you could have language folders for each language
containing the localizations for the respective language.
If we assume, that all the id's are unique, DTML
code similar to this can be used for selection:

<dtml-with "_[LANGUAGE]">
  <dtml-var "_[id]">
</dtml-with>


Dieter