From 509d4b928843f265f06062312d58cc245152f65f Mon Sep 17 00:00:00 2001 From: Jim Laney Date: Mon, 4 Nov 2024 09:41:39 -0800 Subject: [PATCH] add _ alias for gettext --- .../locale/en/LC_MESSAGES/djangojs.mo | Bin 16744 -> 16208 bytes .../locale/en/LC_MESSAGES/djangojs.po | 83 ++++++++++-------- .../components/import/canvas.vue | 12 +-- .../components/import/upload.vue | 46 +++++----- .../components/workflow/confirm-grades.vue | 7 +- .../components/workflow/edit-grades.vue | 10 +-- course_grader_vue/layouts/default.vue | 8 +- course_grader_vue/main.js | 3 + course_grader_vue/pages/term.vue | 8 +- course_grader_vue/utils/grade.js | 2 +- course_grader_vue/utils/section.js | 4 +- 11 files changed, 100 insertions(+), 83 deletions(-) diff --git a/course_grader/locale/en/LC_MESSAGES/djangojs.mo b/course_grader/locale/en/LC_MESSAGES/djangojs.mo index 9e90199c3c29c519bec14e35810c31602ce8f517..a5fa442a39600601f524f0abba29b9f8b341c070 100644 GIT binary patch delta 5270 zcmZXW3vgA%8OQeqA_O%A0t6Ba2L$pELXek{H;F(5Qqu?uQsN~!36~`IUhla9MB#!@ z)XKwC1zO*NBI2vJC@EOcI@79CwIiLrm^xZ*QAbB~I_NOt^!LAKV`JU9|MT13v-|D0 z-+p_NQ#Xa)*_`^vz~1*7%5gMYI>(q$2%blS;^Y~V4M)O0umtim6D;SzT-x=pKfD$W zhH*Fm-e$SS@*pgr{}>!%Ov;>~GL()_gAUW1S#qSv@)D@`OCdiK@tdH=`%nu$3uW&WsH6HTEQY6G3a3pUW@%y}5ACoL>MSpTGO!Sy4_83# zWDS&|+n^k{7oH2Bgo@ZyXZ~7u8h_OC&u|3oub}4VGpGcPh5cY%iVBHumczbq zEmUYdsARec%HRV~4s}88pvHX#6`@=jnqLWJcQ(|~T>&+J71Rde_I+v_6?wK7 zk`Lw(M4YC=t7;3>5$XK%pD%5+SlId9}LtRj3eFAFS8K@-8#|zDOpdvO6%I+el zb=(X&|Bbd|2h`5?K}F=4?SC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B0t0vgGqkX(}l||F)+MM6>m+{ zyP;UP8M`}(AXEDCM zsWsw8f{CsZBqHs=hh?T?OAeX#!@F)>$96#$1t)SgZ1`G}zH-BVGtNy~rzXF_yu5$6 zFEemban_>FM*23&Kgkpai=~`3(bNj3{d(AQb%f?W+2l={eA7zb-R%M9=(T9Q z$^U)3%rlcGX7#9zHpCq6Yv$uK`eyq9kHno=JQc(}9BXszB_@AtESJX~w1Y^*+>NVxT>@lFdbB%$DCEKh~&Q<{-* zB5n)oHsjDSNoQfS*>!5`SGbYZCfBKs#}mAF;Z!_PmigNote: Writing credit automatically given to all students with a passing grade in this course." @@ -323,12 +329,6 @@ msgstr "Return to the list of classes you can grade." msgid "grade_submitted_by" msgstr "grades submitted by" -msgid "grade_submitted_to_registrar" -msgstr "One grade submitted to the Registrar by %(submitted_by)s on %(submitted_date)s." - -msgid "grades_submitted_to_registrar" -msgstr "%(submitted_count)s grades submitted to the Registrar by %(submitted_by)s on %(submitted_date)s." - msgid "change_submitted_grades" msgstr "Change submitted grades" @@ -421,6 +421,18 @@ msgstr "Select a CSV file to Import" msgid "file_size_exceeded" msgstr "Allowable file size exceeded (2 Mb)." +msgid "csv_grade_types" +msgstr "An imported CSV file can contain final grades or percentages. You will be prompted to convert percentages during the import process." + +msgid "csv_required_cols" +msgstr "The CSV is required to contain at least two columns:" + +msgid "required_col_student" +msgstr "a column for student identifier (SIS User ID or StudentNo) AND" + +msgid "required_col_grade" +msgstr "a column for grades to be submitted (ImportGrade)" + msgid "missing_header_grade" msgstr "Missing column heading: "ImportGrade"" @@ -439,6 +451,9 @@ msgstr "File" msgid "select_different_file" msgstr "Select a different file for import." +msgid "convert_percentages_help_title" +msgstr "Learn about converting percentages on IT Connect" + msgid "no_grades_found_csv" msgstr "No grades found for %(section_name)s in this CSV file." @@ -454,6 +469,18 @@ msgstr "Learn about other options to submit grades on IT Connect" msgid "import_canvas_error" msgstr "There was an error importing grades from Canvas" +msgid "confirm_grade_column" +msgstr "Confirm that the ImportGrade column contains grade values." + +msgid "confirm_student_column" +msgstr "Confirm that the SIS User ID or StudentNo column contains student identifiers." + +msgid "confirm_roster_students" +msgstr "Confirm that the .csv file contains students from this section's roster." + +msgid "import_other_options" +msgstr "See other options for submitting grades." + msgid "import_conversion_required" msgstr "The Office of the Registrar requires submitted grades to follow official formatting." @@ -463,27 +490,9 @@ msgstr "Please select a format to use:" msgid "import_select_different_file" msgstr "To select a different file, click Cancel." -msgid "import_grade_found" -msgstr "One grade found for %(section_name)s in %(source_name)s." - -msgid "import_grades_found" -msgstr "%(grade_count)s total grades found for %(section_name)s in %(source_name)s." - -msgid "import_override_grade_found" -msgstr "You have one final grade override in this Canvas Grade Import. This grade WILL BE included in the imported grades." - -msgid "import_override_grades_found" -msgstr "You have {{ override_grade_count }} final grade overrides in this Canvas Grade Import. These grades WILL BE included in the imported grades." - msgid "import_override_grades_title" msgstr "Learn more about importing grade overrides on IT Connect" -msgid "import_unposted_grade_found" -msgstr "You have one student with unposted grades in this Canvas Grade Import." - -msgid "import_unposted_grades_found" -msgstr "You have {{ unposted_grade_count }} students with unposted grades in this Canvas Grade Import." - msgid "import_unposted_grade_warning" msgstr "Unposted grades ARE NOT represented in the imported final grade." @@ -514,8 +523,8 @@ msgstr "Convert grades using a scale that you have used before:" msgid "previous_scale_label" msgstr "Use one of your previous conversion scales" -msgid "no_classes_to_grade" -msgstr "You do not have any classes to grade for %(quarter)s %(year)s. If you believe this to be incorrect, please contact your department's Time Schedule Coordinator." +msgid "You do not have any classes to grade for %(quarter)s %(year)s. If you believe this to be incorrect, please contact your department's Time Schedule Coordinator." +msgstr "" msgid "import_canvas_btn" msgstr "Canvas Gradebook" diff --git a/course_grader_vue/components/import/canvas.vue b/course_grader_vue/components/import/canvas.vue index 7c5a5c7..5e843a3 100644 --- a/course_grader_vue/components/import/canvas.vue +++ b/course_grader_vue/components/import/canvas.vue @@ -100,8 +100,8 @@ export default { computed: { gradesFoundText() { return interpolate(ngettext( - "import_grade_found", - "import_grades_found", + "One grade found for %(section_name)s in %(source_name)s.", + "%(grade_count)s total grades found for %(section_name)s in %(source_name)s.", this.appState.gradeImport.grade_count), { section_name: this.section.section_name, source_name: this.appState.gradeImport.source_name, @@ -115,8 +115,8 @@ export default { }, overrideGradesFoundText() { return interpolate(ngettext( - "import_override_grade_found", - "import_override_grades_found", + "You have one final grade override in this Canvas Grade Import. This grade WILL BE included in the imported grades.", + "You have %(override_grade_count)s final grade overrides in this Canvas Grade Import. These grades WILL BE included in the imported grades.", this.appState.gradeImport.override_grade_count), { override_grade_count: this.appState.gradeImport.override_grade_count }, true @@ -124,8 +124,8 @@ export default { }, unpostedGradesFoundText() { return interpolate(ngettext( - "import_unposted_grade_found", - "import_unposted_grades_found", + "You have one student with unposted grades in this Canvas Grade Import.", + "You have %(unposted_grade_count)s students with unposted grades in this Canvas Grade Import.", this.appState.gradeImport.unposted_grade_count), { unposted_grade_count: this.appState.gradeImport.unposted_grade_count }, true diff --git a/course_grader_vue/components/import/upload.vue b/course_grader_vue/components/import/upload.vue index 794dab4..a013228 100644 --- a/course_grader_vue/components/import/upload.vue +++ b/course_grader_vue/components/import/upload.vue @@ -5,10 +5,7 @@

- {{ appState.gradeImport.grade_count }} of - {{ expectedGradeCount }} - {{ ngettext("grade", "grades", expectedGradeCount) }} found in the file - {{ file.name }} +

@@ -21,30 +18,28 @@

{{ expectedGradeCountText }}

-

The CSV is required to contain at least two columns:

+

{{ gettext("csv_required_cols") }}

    -
  • a column for student identifier (SIS User ID or StudentNo) AND
  • -
  • a column for grades to be submitted (ImportGrade)
  • +
  • +

- An imported CSV file can contain letter grades, grade codes, or - percentages. You will be prompted to + {{ gettext("csv_grade_types") }} - convert percentages - during the import process.

- {{ gettext('format_csv_help') }}

@@ -105,12 +100,12 @@

- Or, see other options for submitting grades. + >

@@ -119,18 +114,18 @@
{{ gettext("file_name") }}: {{ file.name }}
    -
  • Confirm that the ImportGrade column contains grade values.
  • -
  • Confirm that the SIS User ID or StudentNo column contains student identifiers.
  • -
  • Confirm that the .csv file contains students from this section's roster.
  • +
  • +
  • +

- Or, see other options for submitting grades. + >

@@ -217,6 +212,17 @@ export default { return interpolate(gettext("importing_grades_for_section"), {section_name: this.section.section_name}, true); }, + gradesFoundText() { + return interpolate(ngettext( + "%(grade_count)s of %(expected_count)s grade found in the file %(file_name)s", + "%(grade_count)s of %(expected_count)s grades found in the file %(file_name)s", + this.appState.gradeImport.grade_count), { + grade_count: this.appState.gradeImport.grade_count, + expected_count: this.expectedGradeCount, + file_name: this.file.name, + }, true + ); + }, noGradesFoundText() { return interpolate(gettext("no_grades_found_csv"), {section_name: this.section.section_name}, true); diff --git a/course_grader_vue/components/workflow/confirm-grades.vue b/course_grader_vue/components/workflow/confirm-grades.vue index cec1736..0134889 100644 --- a/course_grader_vue/components/workflow/confirm-grades.vue +++ b/course_grader_vue/components/workflow/confirm-grades.vue @@ -172,7 +172,8 @@ v-if="submission.grade_import.import_conversion" :value="submission.grade_import.import_conversion" > - Section {{ submission.section_id }} + + {{ gettext("section") }} {{ submission.section_id }} @@ -278,8 +279,8 @@ export default { methods: { gradesSubmittedText(submission) { return interpolate(ngettext( - "grade_submitted_to_registrar", - "grades_submitted_to_registrar", + "One grade submitted to the Registrar by %(submitted_by)s on %(submitted_date)s.", + "%(submitted_count)s grades submitted to the Registrar by %(submitted_by)s on %(submitted_date)s.", submission.submitted_count), { submitted_count: submission.submitted_count, submitted_by: submission.submitted_by, diff --git a/course_grader_vue/components/workflow/edit-grades.vue b/course_grader_vue/components/workflow/edit-grades.vue index 0f0ee8c..cfbdeb6 100644 --- a/course_grader_vue/components/workflow/edit-grades.vue +++ b/course_grader_vue/components/workflow/edit-grades.vue @@ -8,7 +8,7 @@ /> - + @@ -79,7 +79,7 @@
- {{ gettext("grading_period_status") }} + {{ $_("Grading Period Status") }}
  • { + return window.gettext(msgid); +} // vue-gtag-next const gaCode = document.body.getAttribute("data-google-analytics"); diff --git a/course_grader_vue/pages/term.vue b/course_grader_vue/pages/term.vue index e400cb0..0b89474 100644 --- a/course_grader_vue/pages/term.vue +++ b/course_grader_vue/pages/term.vue @@ -90,11 +90,9 @@ export default { ); }, noClassesWarning() { - return interpolate( - gettext("no_classes_to_grade"), - this.selectedTerm, - true - ); + return interpolate(gettext( + "You do not have any classes to grade for %(quarter)s %(year)s. If you believe this to be incorrect, please contact your department's Time Schedule Coordinator." + ), this.selectedTerm, true); }, }, methods: { diff --git a/course_grader_vue/utils/grade.js b/course_grader_vue/utils/grade.js index 2a33ec0..2a60865 100644 --- a/course_grader_vue/utils/grade.js +++ b/course_grader_vue/utils/grade.js @@ -89,7 +89,7 @@ function validateGrade(grade, incomplete, choices) { // H/HP/P/F return gettext("grade_invalid_H_HP_P_F"); } else { - return "Enter a valid grade"; + return gettext("enter_valid_grade"); } } diff --git a/course_grader_vue/utils/section.js b/course_grader_vue/utils/section.js index c7ec1c6..150212c 100644 --- a/course_grader_vue/utils/section.js +++ b/course_grader_vue/utils/section.js @@ -2,10 +2,10 @@ import { formatLongDateTime } from "@/utils/dates"; function formatLinkTitle(data) { if (data.unsubmitted_count && data.grading_period_open) { - return "Submit grades for " + data.display_name; + return interpolate("submit_grades_title", data, true); } else { if (data.submitted_count && data.submitted_date) { - return "View grade receipt for " + data.display_name; + return interpolate("submitted_grades_title", data, true); } } }