Re: getFormatter

Carsten Senger <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <06F964EB8E3DA468E876921D@[192.168.178.26]>
--On Dienstag, Februar 22, 2011 13:51:03 +0100 [email protected] wrote:

> In den Release Notes von Zope 2.11 steht folgendes:
> The ZPublisher HTTP request has now both the debug and locale
>         attributes available, like its Zope 3 counterpart. The debug 
attribute
>         was so far limited to code from the zope.* namespace in order to 
make
>         the Zope 3 ZPT engine work. The locale attribute provides access 
to an
>         zope.i18n.interfaces.locales.ILocale object with access to locale
>         related information like date / time formatting or translated 
language
>         and country names. Form variables of both debug and locale will 
shadow
>         these two attributes and their use is therefor discouraged.
>
> Ich hatte gehofft, dass ich jetzt in einem Page Template genauso wie in
> Zope 3 folgendes benutzen könnte:
>
> python:request.locale.dates.getFormatter('dateTime')
>
> Aber das funktioniert leider nicht. Ich muss gestehen dass ich den
> letzten Teil der Bemerkung in den Release Notes nicht verstehe,
> vielleicht liegt es daran.

Ich nutze das, allerdings auf Zope2.12. Was heißt denn, dass es nicht
funktioniert?
Eventuell musst Du configure.zcml aus zope.i18n[.locales] einbinden.

..Carsten





_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.