Merge pull request #77 from miurahr/i18n-more

internationalize some messages
This commit is contained in:
Patrick Altman 2015-06-18 23:01:20 -05:00
commit c97711d9b7

View file

@ -14,6 +14,8 @@ from django.contrib import messages
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
from account.models import EmailAddress from account.models import EmailAddress
from symposion.proposals.models import ( from symposion.proposals.models import (
ProposalBase, ProposalSection, ProposalKind ProposalBase, ProposalSection, ProposalKind
@ -36,18 +38,18 @@ def get_form(name):
def proposal_submit(request): def proposal_submit(request):
if not request.user.is_authenticated(): if not request.user.is_authenticated():
messages.info(request, "To submit a proposal, please " messages.info(request, _("To submit a proposal, please "
"<a href='{0}'>log in</a> and create a speaker profile " "<a href='{0}'>log in</a> and create a speaker profile "
"via the dashboard.".format(settings.LOGIN_URL)) "via the dashboard.".format(settings.LOGIN_URL)))
return redirect("home") # @@@ unauth'd speaker info page? return redirect("home") # @@@ unauth'd speaker info page?
else: else:
try: try:
request.user.speaker_profile request.user.speaker_profile
except ObjectDoesNotExist: except ObjectDoesNotExist:
url = reverse("speaker_create") url = reverse("speaker_create")
messages.info(request, "To submit a proposal, first " messages.info(request, _("To submit a proposal, first "
"<a href='{0}'>create a speaker " "<a href='{0}'>create a speaker "
"profile</a>.".format(url)) "profile</a>.".format(url)))
return redirect("dashboard") return redirect("dashboard")
kinds = [] kinds = []