From 5e3b99d4cfc50857566688c543866c82ff51dc4d Mon Sep 17 00:00:00 2001 From: vanschelven Date: Thu, 15 Nov 2012 22:53:08 +0100 Subject: [PATCH] Update django/contrib/flatpages/forms.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translate before passing in the variables (i.e. close the bracket earlier). If you translate after passing in the variables the translated value will contain the actual values for 'url' and 'site' and will therefore not be translated. (I'm not actually using django's flatpages, but I ran into thisĀ apparentĀ error when doing a global grep on my own project) --- django/contrib/flatpages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/flatpages/forms.py b/django/contrib/flatpages/forms.py index e0a63e4323..a848875a9f 100644 --- a/django/contrib/flatpages/forms.py +++ b/django/contrib/flatpages/forms.py @@ -35,7 +35,7 @@ class FlatpageForm(forms.ModelForm): for site in sites: if same_url.filter(sites=site).exists(): raise forms.ValidationError( - _('Flatpage with url %(url)s already exists for site %(site)s' % - {'url': url, 'site': site})) + _('Flatpage with url %(url)s already exists for site %(site)s') % + {'url': url, 'site': site}) return super(FlatpageForm, self).clean()