[Zope-CMF] I18n

Joachim Werner joe@iuveno-net.de
Fri, 28 Sep 2001 18:23:42 +0200


> But the action box e.g. isn't any hardcoded dtml doc - it's comming from
> the fs.
> So how would one translate these `???

Not really. There is a skin file called "actions_box" that you can customize
without a problem. Just do the usual things (click on the filesystem view of
the file and choose "customize") and than do the following: Whenever there
is a <dtml-var name> (or similar variable calls), you replace it by

 <dtml-fish dst=da label="name">

or similar. For dst (the "destination language") you can either hard-code
Danish (dst=da) or use a variable like dst="HTTP_ACCEPT_LANGUAGE".

Normally the language choice should work automatically, using
HTTP_ACCEPT_LANGUAGE. But I didn't get it to work with CMF on my test
server. If it works for you, you can skip the "dst=..." part.

What happens is that if the "name" of the action is "Preferences", ZBabel
looks up the label "Preferences" in the BabelTower (where you should provide
a Danish translation of course) and replaces it by the translation.

The cool thing is that you will NOT have to translate the labels in the
Actions settings of the CMF. The whole system can use English internally.
Just for the display, the phrases and labels are translated ...

Cheers

Joachim.