Skip to content

Commit

Permalink
Transform value to unicode before translating. Fix smcmahon#182
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer authored and mauritsvanrees committed Dec 6, 2016
1 parent 709f625 commit 6829d2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Change History
1.8.3 (unreleased)
------------------

- Nothing changed yet.
- Transform value to unicode before translating. Fix #182
[pbauer]


1.8.2 (2016-11-22)
Expand Down
4 changes: 3 additions & 1 deletion Products/PloneFormGen/content/field_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from Products.Archetypes.Renderer import renderer
from Products.CMFPlone.utils import safe_unicode
from zope.i18n import translate

import cgi
Expand All @@ -24,7 +26,7 @@ def __getattr__(self, name):
def wDescription(self, instance, **kwargs):
value = self.obj.description
if value:
value = translate(value, context=instance.REQUEST)
value = translate(safe_unicode(value), context=instance.REQUEST)
return cgi.escape(value)
else:
return value
Expand Down

0 comments on commit 6829d2f

Please sign in to comment.