From 84a78e8584977c6453e4a95eb18fd17a28206412 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sat, 14 Jul 2012 09:19:45 +0200 Subject: [PATCH] #290 fix unicode problem for python 2.5 in strftime --- openslides/utils/pdf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openslides/utils/pdf.py b/openslides/utils/pdf.py index 8dbc727a6..81af42171 100755 --- a/openslides/utils/pdf.py +++ b/openslides/utils/pdf.py @@ -20,7 +20,8 @@ from reportlab.pdfbase.ttfonts import TTFont from reportlab.rl_config import defaultPageSize from django.conf import settings -from django.utils.translation import ugettext as _ +# Import gettext for python 2.5 support +from django.utils.translation import ugettext as _, gettext from openslides.config.models import config @@ -221,7 +222,7 @@ def firstPage(canvas, doc): # time canvas.setFont('Ubuntu', 7) - time = datetime.now().strftime(_("%Y-%m-%d %H:%Mh")) + time = datetime.now().strftime(gettext("%Y-%m-%d %H:%Mh")) canvas.drawString(15 * cm, 28 * cm, _("Printed: %s") % time) # title