Fix missing translator comments

Turns out if the string literal starts on the next line after the
translation function, then the translator comment is lost.  So, either
close up short strings, or add a dummy empty string on the first line to
concatenate with the real string.

Ugh.
This commit is contained in:
Ned Batchelder
2015-12-03 12:53:11 -05:00
parent 1cee9a0dcd
commit 67c1cdf5f4
4 changed files with 31 additions and 41 deletions

View File

@@ -73,9 +73,9 @@ class LoginSessionView(APIView):
# Translators: These instructions appear on the login form, immediately
# below a field meant to hold the user's email address.
email_instructions = _(
u"The email address you used to register with {platform_name}"
).format(platform_name=settings.PLATFORM_NAME)
email_instructions = _("The email address you used to register with {platform_name}").format(
platform_name=settings.PLATFORM_NAME
)
form_desc.add_field(
"email",
@@ -267,15 +267,17 @@ class RegistrationView(APIView):
conflicts = check_account_exists(email=email, username=username)
if conflicts:
conflict_messages = {
# Translators: This message is shown to users who attempt to create a new
# account using an email address associated with an existing account.
"email": _(
u"It looks like {email_address} belongs to an existing account. Try again with a different email address." # pylint: disable=line-too-long
# Translators: This message is shown to users who attempt to create a new
# account using an email address associated with an existing account.
u"It looks like {email_address} belongs to an existing account. "
u"Try again with a different email address."
).format(email_address=email),
# Translators: This message is shown to users who attempt to create a new
# account using a username associated with an existing account.
"username": _(
u"It looks like {username} belongs to an existing account. Try again with a different username."
# Translators: This message is shown to users who attempt to create a new
# account using a username associated with an existing account.
u"It looks like {username} belongs to an existing account. "
u"Try again with a different username."
).format(username=username),
}
errors = {
@@ -387,11 +389,11 @@ class RegistrationView(APIView):
# meant to hold the user's public username.
username_label = _(u"Public username")
# Translators: These instructions appear on the registration form, immediately
# below a field meant to hold the user's public username.
username_instructions = _(
# Translators: These instructions appear on the registration form, immediately
# below a field meant to hold the user's public username.
u"The name that will identify you in your courses - "
"{bold_start}(cannot be changed later){bold_end}"
u"{bold_start}(cannot be changed later){bold_end}"
).format(bold_start=u'<strong>', bold_end=u'</strong>')
# Translators: This example username is used as a placeholder in
@@ -542,9 +544,9 @@ class RegistrationView(APIView):
"""
# Translators: This phrase appears above a field on the registration form
# meant to hold the user's reasons for registering with edX.
goals_label = _(
u"Tell us why you're interested in {platform_name}"
).format(platform_name=settings.PLATFORM_NAME)
goals_label = _(u"Tell us why you're interested in {platform_name}").format(
platform_name=settings.PLATFORM_NAME
)
form_desc.add_field(
"goals",
@@ -627,18 +629,14 @@ class RegistrationView(APIView):
# Translators: "Terms of Service" is a legal document users must agree to
# in order to register a new account.
label = _(
u"I agree to the {platform_name} {terms_of_service}."
).format(
label = _(u"I agree to the {platform_name} {terms_of_service}.").format(
platform_name=settings.PLATFORM_NAME,
terms_of_service=terms_link
)
# Translators: "Terms of Service" is a legal document users must agree to
# in order to register a new account.
error_msg = _(
u"You must agree to the {platform_name} {terms_of_service}."
).format(
error_msg = _(u"You must agree to the {platform_name} {terms_of_service}.").format(
platform_name=settings.PLATFORM_NAME,
terms_of_service=terms_link
)
@@ -674,18 +672,14 @@ class RegistrationView(APIView):
# Translators: "Terms of service" is a legal document users must agree to
# in order to register a new account.
label = _(
u"I agree to the {platform_name} {terms_of_service}."
).format(
label = _(u"I agree to the {platform_name} {terms_of_service}.").format(
platform_name=settings.PLATFORM_NAME,
terms_of_service=terms_link
)
# Translators: "Terms of service" is a legal document users must agree to
# in order to register a new account.
error_msg = _(
u"You must agree to the {platform_name} {terms_of_service}."
).format(
error_msg = _(u"You must agree to the {platform_name} {terms_of_service}.").format(
platform_name=settings.PLATFORM_NAME,
terms_of_service=terms_link
)
@@ -784,9 +778,9 @@ class PasswordResetView(APIView):
# Translators: These instructions appear on the password reset form,
# immediately below a field meant to hold the user's email address.
email_instructions = _(
u"The email address you used to register with {platform_name}"
).format(platform_name=settings.PLATFORM_NAME)
email_instructions = _(u"The email address you used to register with {platform_name}").format(
platform_name=settings.PLATFORM_NAME
)
form_desc.add_field(
"email",