[Zope] The date in Dutch
Diny van Gool
dvg@vet.uu.nl
Fri, 18 Aug 2000 10:06:08 +0200
At 19:45 17-8-00 +0200, Michel Houben wrote:
>How can I fix the date in Dutch, for example Donderdag 17 Augustus 2000
>instead of Thursday 17 August 2000. I hope someone can solve this problem.
>
>Michel Houben.
Hi,
You can do this by using a python external method:
Example:
In your dtml-method where you display the date use:
<dtml-var "timetodutch(bobobase_modification_time)">
The timetodutch is the external python method where you create your date
layout. I wrote one (see below) to try if this is working because I'm new
to python. Zope isn't passing the bobobase_modication_time to the python
method and I don't know why. If I'm missing something here which is easy to
solve then you have your date to dutch translator.
Diny
def timetodutch(datetime):
#When I test this python method with the variables all set it is working
year = '2000'
month = '08'
Day = 'Friday'
day = 18
#Using the year = datetime.year() isn't working, and I don't know why
because I think it should.
#Zope isn't passing the bobobase_modication_time to this python method.
#When I try to display datetime then it's empty.
#year = datetime.year()
#month = datetime.mm()
#Day = datetime.Day()
#day = datetime.day()
months = {"01" : "Januari",
"02" : "Februari",
"03" : "Maart",
"04" : "April",
"05" : "Mei",
"06" : "Juni",
"07" : "Juli",
"08" : "Augustus",
"09" : "September",
"10" : "Oktober",
"11" : "November",
"12" : "December"}
days = {"Monday" : "Maandag",
"Tuesday" : "Dinsdag",
"Wednesday" : "Woensdag",
"Thursday" : "Donderdag",
"Friday" : "Vrijdag",
"Saturday" : "Zaterdag",
"Sunday" : "Zondag"}
month = months[month]
Day = days[Day]
s = "%s %s %s %s" % (Day, day, month, year)
return s
DIVA, Faculty of Veterinary Medicine
Utrecht University, The Netherlands
http://www.vet.uu.nl