Skip to content

Commit 19a27e7

Browse files
author
Richard Jones
committed
Handle 8-bit untranslateable messages from database properties
1 parent a8c16e1 commit 19a27e7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Fixed:
77
- Updated documentation for customising hard-coded searches in page.html
88
- Updated Windows installation docs (thanks Bo Berglund)
99
- Handle rounding of seconds generating invalid date values
10+
- Handle 8-bit untranslateable messages from database properties
1011

1112

1213
2006-12-19 1.3.2

roundup/cgi/TranslationService.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# translate(domain, msgid, mapping, context, target_language, default)
1414
#
1515

16-
__version__ = "$Revision: 1.3 $"[11:-2]
17-
__date__ = "$Date: 2006-12-02 23:41:28 $"[7:-2]
16+
__version__ = "$Revision: 1.4 $"[11:-2]
17+
__date__ = "$Date: 2007-01-14 22:54:15 $"[7:-2]
1818

1919
from roundup import i18n
2020
from roundup.cgi.PageTemplates import Expressions, PathIterator, TALES
@@ -35,6 +35,8 @@ def translate(self, domain, msgid, mapping=None,
3535
return _msg
3636

3737
def gettext(self, msgid):
38+
if not isinstance(msgid, unicode):
39+
msgid = unicode(msgid, 'utf8')
3840
return self.ugettext(msgid).encode(self.OUTPUT_ENCODING)
3941

4042
def ngettext(self, singular, plural, number):

0 commit comments

Comments
 (0)