From af6384450948c3c1f98a458f072129f246310316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 2 Mar 2012 16:29:02 +0100 Subject: [PATCH] Strip \\r from translated messages --- trans/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trans/forms.py b/trans/forms.py index f379806e4..d726becb9 100644 --- a/trans/forms.py +++ b/trans/forms.py @@ -20,12 +20,13 @@ class PluralTextarea(forms.Textarea): return mark_safe('
'.join(ret)) def value_from_datadict(self, data, files, name): - ret = [smart_unicode(data.get(name, None))] + ret = [data.get(name, None)] for idx in range(1, 10): fieldname = '%s_%d' % (name, idx) if not fieldname in data: break - ret.append(smart_unicode(data.get(fieldname, None))) + ret.append(data.get(fieldname, None)) + ret = [smart_unicode(r.replace('\r', '')) for r in ret] if len(ret) == 0: return ret[0] return ret