Repository navigation
I18n fix by Tsinghua #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I18n fix by Tsinghua #672
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,35 @@ | ||
| <li class="field-group course-grading-assignment-list-item"> | ||
| <div class="field text" id="field-course-grading-assignment-name"> | ||
| <label for="course-grading-assignment-name">Assignment Type Name</label> | ||
| <input type="text" class="long" id="course-grading-assignment-name" value="<%= model.get('type') %>" /> | ||
| <span class="tip tip-stacked">e.g. Homework, Midterm Exams</span> | ||
| <label for="course-grading-assignment-name"><%= gettext("Assignment Type Name") %></label> | ||
| <input type="text" class="long" id="course-grading-assignment-name" value="<%= model.get('type') %>" /> | ||
| <span class="tip tip-stacked"><%= gettext("e.g. Homework, Midterm Exams") %></span> | ||
| </div> | ||
|
|
||
| <div class="field text" id="field-course-grading-assignment-shortname"> | ||
| <label for="course-grading-assignment-shortname">Abbreviation:</label> | ||
| <label for="course-grading-assignment-shortname"><%= gettext("Abbreviation:") %></label> | ||
| <input type="text" class="short" id="course-grading-assignment-shortname" value="<%= model.get('short_label') %>" /> | ||
| <span class="tip tip-inline">e.g. HW, Midterm</span> | ||
| <span class="tip tip-inline"><%= gettext("e.g. HW, Midterm") %></span> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we're here, can we drop the elite "e.g." in favor of "for example" ? |
||
| </div> | ||
|
|
||
| <div class="field text" id="field-course-grading-assignment-gradeweight"> | ||
| <label for="course-grading-assignment-gradeweight">Weight of Total Grade</label> | ||
| <label for="course-grading-assignment-gradeweight"><%= gettext("Weight of Total Grade") %></label> | ||
| <input type="text" class="short" id="course-grading-assignment-gradeweight" value = "<%= model.get('weight') %>" /> | ||
| <span class="tip tip-inline">e.g. 25%</span> | ||
| <span class="tip tip-inline"><%= gettext("e.g. 25%") %></span> | ||
| </div> | ||
|
|
||
| <div class="field text" id="field-course-grading-assignment-totalassignments"> | ||
| <label for="course-grading-assignment-totalassignments">Total | ||
| Number</label> | ||
| <label for="course-grading-assignment-totalassignments"><%= gettext("Total Number") %></label> | ||
| <input type="text" class="short" id="course-grading-assignment-totalassignments" value = "<%= model.get('min_count') %>" /> | ||
| <span class="tip tip-inline">total exercises assigned</span> | ||
| <span class="tip tip-inline"><%= gettext("total exercises assigned") %></span> | ||
| </div> | ||
|
|
||
| <div class="field text" id="field-course-grading-assignment-droppable"> | ||
| <label for="course-grading-assignment-droppable">Number of | ||
| Droppable</label> | ||
| <label for="course-grading-assignment-droppable"><%= gettext("Number of Droppable") %></label> | ||
| <input type="text" class="short" id="course-grading-assignment-droppable" value = "<%= model.get('drop_count') %>" /> | ||
| <span class="tip tip-inline">total exercises that won't be graded</span> | ||
| <span class="tip tip-inline"><%= gettext("total exercises that won't be graded") %></span> | ||
| </div> | ||
|
|
||
| <div class="actions"> | ||
| <a href="#" class="button delete-button standard remove-item remove-grading-data"><span class="delete-icon"></span>Delete</a> | ||
| <a href="#" class="button delete-button standard remove-item remove-grading-data"><span class="delete-icon"></span><%= gettext("Delete") %></a> | ||
| </div> | ||
| </li> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,7 +326,7 @@ <h2>${_('Are you sure you want to unregister from {course_number}?').format(cour | |
| <input name="course_id" id="unenroll_course_id" type="hidden" /> | ||
| <input name="enrollment_action" type="hidden" value="unenroll" /> | ||
| <div class="submit"> | ||
| <input name="submit" type="submit" value="Unregister" /> | ||
| <input name="submit" type="submit" value=${_("Unregister")} /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe that submit action values should be translated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are shown on the button, though. I think the only way to send a different value than the text on the button is to use <button> rather than <input>
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actual input is here: type="hidden" value="unenroll"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should ${_("Unregister")} be put in quotations?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it'll break the HTML without the outer quotes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dfnjy , can you put the value in quotations? |
||
| </div> | ||
| </form> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%namespace file="../main.html" import="stanford_theme_enabled" /> | ||
|
|
||
| Thank you for signing up for ${settings.PLATFORM_NAME}! To activate | ||
| your account, please copy and paste this address into your web | ||
| browser's address bar: | ||
| ${_("Thank you for signing up for %s! To activate your account, please copy and paste this address into your web browser's address bar:") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
|
|
||
| % if is_secure: | ||
| https://${ site }/activate/${ key } | ||
|
|
@@ -12,13 +11,7 @@ browser's address bar: | |
|
|
||
| ## Temporary hack until we develop a better way to adjust language | ||
| % if stanford_theme_enabled(): | ||
| If you didn't request this, you don't need to do anything; you won't | ||
| receive any more email from us. Please do not reply to this e-mail; | ||
| if you require assistance, check the about section of the | ||
| ${settings.PLATFORM_NAME} Courses web site. | ||
| ${_("If you didn't request this, you don't need to do anything; you won't receive any more email from us. Please do not reply to this e-mail; if you require assistance, check the about section of the %s Courses web site.") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| % else: | ||
| If you didn't request this, you don't need to do anything; you won't | ||
| receive any more email from us. Please do not reply to this e-mail; | ||
| if you require assistance, check the help section of the | ||
| ${settings.PLATFORM_NAME} web site. | ||
| ${_("If you didn't request this, you don't need to do anything; you won't receive any more email from us. Please do not reply to this e-mail; if you require assistance, check the help section of the %s web site.") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| % endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| Your account for ${settings.PLATFORM_NAME} | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| ${_("Your account for %s") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%namespace file="../main.html" import="stanford_theme_enabled" /> | ||
| We received a request to change the e-mail associated with your | ||
| ${settings.PLATFORM_NAME} account from ${old_email} to ${new_email}. | ||
| If this is correct, please confirm your new e-mail address by | ||
| visiting: | ||
| ${_("We received a request to change the e-mail associated with your %s account from %s to %s. If this is correct, please confirm your new e-mail address by visiting:") % (settings.PLATFORM_NAME,old_email,new_email)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
|
|
||
| % if is_secure: | ||
| https://${ site }/email_confirm/${ key } | ||
|
|
@@ -12,13 +10,7 @@ visiting: | |
|
|
||
| ## TODO: fix this ugly hack | ||
| % if stanford_theme_enabled(): | ||
| If you didn't request this, you don't need to do anything; you won't | ||
| receive any more email from us. Please do not reply to this e-mail; | ||
| if you require assistance, check the about section of the | ||
| ${settings.PLATFORM_NAME} Courses web site. | ||
| ${_("If you didn\'t request this, you don\'t need to do anything; you won\'t receive any more email from us. Please do not reply to this e-mail; if you require assistance, check the about section of the %s Courses web site.") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| % else: | ||
| If you didn't request this, you don't need to do anything; you won't | ||
| receive any more email from us. Please do not reply to this e-mail; | ||
| if you require assistance, check the help section of the | ||
| ${settings.PLATFORM_NAME} web site. | ||
| ${_("If you didn\'t request this, you don\'t need to do anything; you won\'t receive any more email from us. Please do not reply to this e-mail; if you require assistance, check the help section of the %s web site.") % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| % endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| Request to change ${settings.PLATFORM_NAME} account e-mail | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| ${_('Request to change %s account e-mail') % (settings.PLATFORM_NAME)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the "format" method for string substitution |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ <h2>${_("Password Reset")}</h2> | |
| <ol class="list-input"> | ||
| <li class="field required text" id="field-email"> | ||
| <label for="pwd_reset_email">${_("Your E-mail Address")}</label> | ||
| <input class="" id="pwd_reset_email" type="email" name="email" value="" placeholder="example: username@domain.com" /> | ||
| <input class="" id="pwd_reset_email" type="email" name="email" value="" placeholder=${_("example: username@domain.com")} /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. html element attributes should be put in quotations: |
||
| <span class="tip tip-input">${_("This is the email address you used to register with {platform}").format(platform=settings.PLATFORM_NAME)}</span> | ||
| </li> | ||
| </ol> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ <h3 class="message-title">${_("The following errors occured while logging you in | |
| <ol class="list-input"> | ||
| <li class="field required text" id="field-email"> | ||
| <label for="email">${_('E-mail')}</label> | ||
| <input class="" id="email" type="email" name="email" value="" placeholder="example: username@domain.com" required aria-required="true" /> | ||
| <input class="" id="email" type="email" name="email" value="" placeholder=${_("example: username@domain.com")} required aria-required="true" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. html elements should be put in quotations |
||
| </li> | ||
| <li class="field required password" id="field-password"> | ||
| <label for="password">${_('Password')}</label> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,11 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| {% load i18n %} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should have already been django-fied, check the latest version on master |
||
| {% load compressed %} | ||
| {% load staticfiles %} | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
|
|
||
| <title>${_("Your Password Reset is Complete")}</title> | ||
| <title>{% trans "Your Password Reset is Complete" %}</title> | ||
|
|
||
| {% compressed_css 'application' %} | ||
|
|
||
|
|
@@ -54,13 +53,13 @@ <h1 class="logo"> | |
| <section class="passwordreset container"> | ||
| <section class="introduction"> | ||
| <header> | ||
| <h1>${_("Your Password Reset is Complete")}</h1> | ||
| <h1>{% trans "Your Password Reset is Complete" %}</h1> | ||
| </header> | ||
| </section> | ||
|
|
||
| {% block content %} | ||
| <section role="main" class="content"> | ||
| <p>${_('Your password has been set. You may go ahead and {link_start}log in{link_end} now.').format(link_start='<a href="/login">', link_end='</a>')}</p> | ||
| <p>{% blocktrans with link_start='<a href="/login">' link_end='</a>' %} Your password has been set. You may go ahead and {{link_start}}log in{{link_end}} now. {% endblocktrans %}</p> | ||
| </section> | ||
| {% endblock %} | ||
| </section> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
django.utils.translation.ugettextshould be imported as_and used here, so that the translation extraction code will pick up these strings to extract.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This HTML seems to be inserted directly. Import statement may course some problems...
We copied these strings to another js file to let them be picked.