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.

I don't know any Dutch.

However, here's an external method that will convert the months and days
of the week in a string from English to German.

There are probably better names for the variables and such, so don't
take this as as example of clear maintainable programming :)

It ought be be pretty efficient.

Assuming you call the external method D_date, use something like this:

  <dtml-var "D_date('October February July, Tuesday, 23 March 2000')">

import re

# you can remove lines where the words are the same in both languages

class re_stored:
  def __init__(self, e, d):
    self.d = d
  def r(self, s):
    return self.regex.sub(self.d, s)

for e,d in replacements.items():

def D_date(datestring):
    return reduce(lambda x,y: y.r(x), replace_regexes, datestring)

Steve Alexander
Software Engineer
Cat-Box limited

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to