changeset 764:09b4d8912dff stable-0.5.x

Ported [888] back to 0.5.x branch.
author cmlenz
date Tue, 17 Jun 2008 15:49:34 +0000
parents ce8f4f90f71e
children f7682ced2777
files ChangeLog genshi/filters/i18n.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
  * Fix problem with nested match templates not being applied when buffering
    on the outer `py:match` is disabled. Thanks to Erik Bray for reporting the
    problem and providing a test case!
+ * Fix problem in `Translator` filter that would cause the translation of
+   text nodes to fail if the translation function returned an object that was
+   not directly a string, but rather something like an instance of the
+   `LazyProxy` class in Babel (ticket #145).
 
 
 Version 0.5
--- a/genshi/filters/i18n.py
+++ b/genshi/filters/i18n.py
@@ -189,7 +189,7 @@
                 if not msgbuf:
                     text = data.strip()
                     if text:
-                        data = data.replace(text, translate(text))
+                        data = data.replace(text, unicode(translate(text)))
                     yield kind, data, pos
                 else:
                     msgbuf.append(kind, data, pos)
Copyright (C) 2012-2017 Edgewall Software