[Zope-dev] Re: [ZIP] dtml-str idea

Federico Di Gregorio fog@mixadlive.com
Thu, 23 Mar 2000 14:37:52 +0100


Scavenging the mail folder uncovered Ibañez Palomar Juan David's letter:
> First, I've just uploaded the vocabulary product to Zope.org,
> download from "http://www.zope.org/Members/jdavid/vocabulary".

ok. you just beated me by some hours! i was about to release my first
product today: L10NFolder. so there it is. note that i copied some of
your code (dtml) because was much cleaner than mine. no XML at now.
README follows...

(emm... i created a product and then a release... how do i make it public?
 ah, the review process, ok... for now you can find the product at:
 http://www.zope.org/Members/fog/l10nfolder)


L10Folder Zope Product
**********************

This is a subclass of the standard folder with some added bonuses. 

First you can add localized properties, much like the Vocabulary product. When
you access the property via a dtml-var tag, you get one of the different
versions based on the contents of the HTTP_ACCEPT_LANGUAGE header, of a cookie
selected by the Zope programmer and on the list of default languages.

Then, the L10NFolder modifies a little bit how acquisition works inside it.  If
a attribute (property) name can't be resolved by the folder itself, it looks
for folders and documents named as the languages in the list of accepted
languages and the tries to resolve the name on them. This leaves space for things like:

  * different subfolders with different images per language
  * very complex pages can be written as dtml documents and then
    translated. after each translated copy is put in its own folder (named it,
    en, etc...), the L10NFolder gets and render the right one.


TODO
----

Testing. Bug hunting. Better performance. Provide some examples.

Add TRANSLATE permission?


CREDITS
-------

The dtml interface to add/modify/delete localized properties has been taken
from the Vocabulary Zope product, by J. David Ibáñez and Andres Marzal
(al028823@alumail.uji.es.) Their code was much cleaner than mine, so many kudos
to them.


AUTHOR
------

C-x i ~/.signature

Federico Di Gregorio
MIXAD LIVE System Programmer                           fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
  Debian. The best software from the best people [see above]
                                      -- brought to you by One Line Spam




 

-- 
Federico Di Gregorio
MIXAD LIVE System Programmer                           fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
             Quis custodiet ipsos custodes? -- Juvenal, Satires, VI, 347