[Zope] Translate the day and Month in Dutch
Gilles Lenfant
gilles@pilotsystems.net
Mon, 16 Dec 2002 15:58:57 +0100
---- Original Message -----
From: "Martin Koekenberg" <zope@digital-adventures.nl>
To: <zope@zope.org>
Sent: Monday, December 16, 2002 2:09 PM
Subject: [Zope] Translate the day and Month in Dutch
> hello,
>
> I've an agenda with event in dutch, mij server uses English day & month
> names. Is there a function or something like that to translate them into
> dutch. Friday -> Vrijdag and January -> januari.
>
> Who can help me ??
>
> Martin Koekenberg
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
Hi,
I made this small TTW script to get the date in a French manner.
You just need to translate the lists "jours" and "mois" respectively with
the list of day names (starting from sunday) and month names (starting with
an empty string, then january,..., december).
The "dto" parameter is expected to be a Zope DateTime object.
Hope this helps.
--Gilles
## Script (Python) "datefr"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=dto
##title=Date en français
##
#
# Paramètre :
# dto : objet de type DateTime
#
jours = ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi',
'Samedi']
mois = ['', 'janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',
'août', 'septembre', 'octobre', 'novembre', 'décembre']
fdate = jours[dto.dow()] + ', '
jj = dto.day()
if jj == 1:
jj = '1er'
return fdate + str(jj) + ' ' + mois[dto.month()] + ' ' + str(dto.year())