[Zope-CMF] Localisation

Christian Dade christian.dade@t-online.de
Sun, 4 Aug 2002 18:16:55 +0200


Hi,

does anybody have an idea how to use german "umlaute" (öäü) or other special
characters within CMF. All special characters are send without translation
to their HTML-equivalents. That works fine with IE, but makes it impossible
to make a german zope/cmf-site accessible, i.e. read it with a braille
device or even with opera.

Volker Bachschneider made a little workaround for structured text, but that
won't do all the job:

CMFcore/utils

def _format_stx( text, level=1 ):
   """
   Render STX to HTML.
   """
   st = StructuredText.Basic( text )   # Creates the basic DOM
   if not st:                          # If it's an empty object
       return ""                       # return now or have errors!

   doc = CMFDocumentClass( st )
   html = CMFHtmlWithImages( doc, level )

html_entities=(('ü','ü'),('ö','ö'),('ä','ä'),('Ü','Ü'),(
'Ö','Ö'),('Ä','Ä'),('ß','ß'))

   for uml in html_entities :
       old,new = uml
       html = html.replace(old,new)

   return html


Christian