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 5 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 +1,2 @@ | ||
| Your account for ${settings.PLATFORM_NAME} | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| ${_("Your account for {0}").format(settings.PLATFORM_NAME)} |
| 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 {0} account e-mail').format(settings.PLATFORM_NAME)} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| <<<<<<< HEAD | ||
| ======= | ||
| {% load i18n %} | ||
| >>>>>>> master | ||
|
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 is a merge conflict! |
||
| {% load compressed %} | ||
| {% load i18n %} | ||
| {% load staticfiles %} | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
@@ -151,4 +155,4 @@ <h3>{% trans "Need Help?" %}</h3> | |
| </div> | ||
| </aside> | ||
| </section> | ||
| </section> | ||
| </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.