[Zope-dev] i18n of zope managed contents

Federico Di Gregorio fog@mixadlive.com
Wed, 23 Feb 2000 14:56:05 +0100


hi *,

	we are starting to build two *big* (international) sites and we
have the need to localize them from the start. i've looked up every
product on the zope site and read the (only?) document about l10n available:
the "Changing Contexts in Zope" text. i still don't see a clean and simple
solution, so i am thinking about writing a product to help with localization.
but i don't want to reinvent the wheel so here's what i am trying to do.
(comments and pointers to documentation are welcome!)

** THE SIMPLIEST WAY **

create an L10N object able to render its contents accordingly to a
global variable (e.g., a cookie.) you just set one property for every
language (property name == language id) and you are done. i can also
throw in some nice dtml to let the translators do their job inside
zope in the properties tab, etc... the main problem here is exponential
object growth. a complex page can easily need teens or hundreds of such
objects.

** THE IMHO BEST WAY **

subclass the Folder object and add (i don't even know if that is possible,
no documentation about it) a new kind of property, lets call it "L10NText."
when the L10NFolder is asked for data, it returns the right translation,
based on the same global variable as above. write some pretty complex dtml
that lets you add L10NText, and, for every L10NText var, add translations.
This approach keeps the number of objects low and all the translated text
is some well-defined place.

what do you zope gurus think about it?

federico 
 
-- 
Federico Di Gregorio
MIXAD LIVE System Programmer                           fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
           Nobody will ever need more than 640k RAM! -- Bill Gates, 1981
           Windows 95 needs at least 8 MB RAM.       -- Bill Gates, 1996
           Nobody will ever need Windows 95.       -- logical conclusion