Update django/contrib/flatpages/forms.py

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)
This commit is contained in:
vanschelven 2012-11-15 22:53:08 +01:00
parent 7cfb567e45
commit 5e3b99d4cf
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class FlatpageForm(forms.ModelForm):
for site in sites: for site in sites:
if same_url.filter(sites=site).exists(): if same_url.filter(sites=site).exists():
raise forms.ValidationError( raise forms.ValidationError(
_('Flatpage with url %(url)s already exists for site %(site)s' % _('Flatpage with url %(url)s already exists for site %(site)s') %
{'url': url, 'site': site})) {'url': url, 'site': site})
return super(FlatpageForm, self).clean() return super(FlatpageForm, self).clean()