SV: [Zope-CMF] Localization
Joachim Werner
joe@iuveno-net.de
Thu, 1 Nov 2001 16:15:25 +0100
> > I do like the gettext approach of Localizer though.
>
> Well I read somewhere that ZBabel will support this in the future ?
Hi!
There is a patch in the ZBabel CVS that adds most of the Localizer-style tag
syntax:
You can do
<dtml-var "BabelTower.gettext('Translate this')">
or
<dtml-var "BabelTower('Tranlsate this')">
now. So if you name your BabelTower exactly like the Message Catalog in
Localizer, all localizer-style code should work out of the box. And this
syntax also works with Zope Page Templates of course.
There also is a <dtml-gettext> tag. But it is not 100% compatible with the
Localizer one. If you want to switch from Localizer, there shouldn't be too
much to change though.
ZBabel now also has a "translate" method available from Python and ZPT. The
syntax is really straightforward: e.g. from Python (filesystem) code, you
just have to write "self.translate('Translate This')".
Import/Export filters for .po files will be available by end of November.
Wait for a new beta release in a couple of days from now that will include
all the new stuff.
Cheers
Joachim