Re: Wochentag mit DateTime in Deutsch ausgeben

Martin Stadler <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
Hallo!

Vielleicht habe ich es viel zu kompliziert gemacht, aber in Plone gibt  
es schon für die Wochentage Übersetzungen und Methoden und die wollte  
ich nutzen.

In meiner View:

     from zope.i18n import translate
     from Products.CMFPlone.i18nl10n import weekdayname_msgid

     class MyCT(BrowserView):
         ...
         def weekdayname(self, day):
             return translate(weekdayname_msgid(day), 'plonelocales',  
self.context, self.request)

Und im Template:

     <span  
tal:content 
="python:view.weekdayname(item.getStart().strftime('%w'))"></span>

Gruß,
Martin


Am 27.02.2010 um 12:00 schrieb Peter Nassauer:

> Danke für die schnelle Antwort:
>
> python:DateTime(item_start).strftime('%A')
>
> hatte ich bereits auch versucht. Allerdings erscheint hier der  
> Wochentag auch nur in Englisch.
>
> Am 27.02.2010 09:28, schrieb Andreas Jung:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>> Peter Nassauer wrote:
>>
>>> Ich würde gerne bei einem Event den Wochentag ausschreiben.
>>>
>>> Mit "python:DateTime(item_start).Day()" bekomme ich auch den Tag,
>>> allerdings nur in Englisch.
>>>
>>> Gibt es eine Möglichkeit den Wochentag in Deutsch anzuzeigen.
>>>
>>>
>> http://docs.python.org/library/datetime.html#strftime-behavior
>>
>> - -aj
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (Darwin)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAkuI18sACgkQCJIWIbr9KYyyxACdEQr6BwLOMRccIe11fqNGPkPO
>> ktoAn1iiWRWQa6EUy2sdlV/gcnf3fs64
>> =PFih
>> -----END PGP SIGNATURE-----



_______________________________________________
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.