Use lazy gettext in models and forms to allow things to be shown in Spanish.

This commit is contained in:
2019-04-07 17:04:02 +01:00
parent 6e34abda84
commit 87e9296007
4 changed files with 95 additions and 52 deletions

View File

@ -5,7 +5,7 @@ from django.contrib.auth.models import User
from django.contrib.gis.db import models
from django.db import connection
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import AutoSlugField
from django_countries.fields import CountryField
@ -657,7 +657,7 @@ class CaseStudy(models.Model):
# Should be filled in if generation_technology was answered as bio-energy
biomass_detail = models.CharField(
verbose_name=_("Bio-energy feedstock"),
help_text="<div class='text-muted'>" + _(
help_text=_("<div class='text-muted'>"
"<p>Please describe the source of the fuel and how it is processed/used."
" Please consider:</p>\n"
"<ul>\n"
@ -669,7 +669,7 @@ class CaseStudy(models.Model):
"</ul>\n"
"<p>We do not expect users to know this information, but if you do "
" it may be useful to give a fuller picture.</p>"
) + "</div>",
"</div>"),
max_length=200,
blank=True
)