[Zope3-dev] would like a "package" for registerTranslations
directive
Steve Alexander
steve at z3u.com
Thu Jun 24 07:25:39 EDT 2004
Hi,
I'm making my own configuration of Zope 3 that uses only selected parts
of zope.app.
To do this, I have my own site.zcml that does not include the
zope/app/configure.zcml.
I have a zopeapp.zcml that is included by my site.zcml, which includes
several of the things from zope/app/configure.zcml.
One of the things I'd like to include is the registerTranslations directive:
<i18n:registerTranslations directory="translation_files" />
I'd like to be able to change it to read:
<i18n:registerTranslations
package="zope.app"
directory="translation_files"
/>
Right now, the registerTranslations directive does not support a
'package' attribute. I could put it in its own zcml file, and set the
package for that file, but that's inelegant.
I looked at adding a 'package' attribute to the registerTranslations
directive, but it isn't straightforward. Specifying a package is easy:
I can just add a GlobalObject field to the metadirective schema.
However, I don't know a good way of getting this package taken into
account when the 'directory' attribute's Path field gets processed.
How would I best go about writing a metadirective that has a 'directory'
attribute and an optional 'package' attribute, where if a relative path
is given for the 'directory', it would be considered relative to the
package?
--
Steve Alexander
More information about the Zope3-dev
mailing list