Skip to content
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

add _ alias for gettext #531

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified course_grader/locale/en/LC_MESSAGES/djangojs.mo
Binary file not shown.
83 changes: 46 additions & 37 deletions course_grader/locale/en/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ msgstr ""

############## Layout ##############

msgid "previous_terms"
msgstr "Previous terms"
msgid "Previous terms"
msgstr ""

msgid "clear_override"
msgstr "Clear override"
msgid "Clear override"
msgstr ""

msgid "logout"
msgstr "Sign out"
msgid "Sign out"
msgstr ""

msgid "grading_period_status"
msgstr "Grading Period Status"
msgid "Grading Period Status"
msgstr ""

############## Class Chooser - Status ##############

Expand All @@ -45,6 +45,9 @@ msgstr ""
msgid "%(submitted_count)s grades submitted"
msgstr ""

msgid "submitted_grades_title"
msgstr "View submitted grades for %(display_name)s"

msgid "%(submitted_count)s grade submission in progress"
msgstr ""

Expand All @@ -57,6 +60,9 @@ msgstr ""
msgid "%(unsubmitted_count)s grades to submit"
msgstr ""

msgid "submit_grades_title"
msgstr "Submit grades for %(display_name)s"

msgid "no_submission_information"
msgstr "No submission information"

Expand Down Expand Up @@ -88,9 +94,6 @@ msgstr "Grading period closes in (remaining_hour) hours!"

############## Header ##############################

msgid "submit_grades_for"
msgstr "Submit grades for"

msgid "submitted_grades_for"
msgstr "Grade Receipt for"

Expand Down Expand Up @@ -196,6 +199,9 @@ msgstr "Saved"
msgid "enter_grades"
msgstr "Enter grades for"

msgid "enter_valid_grade"
msgstr "Enter a valid grade"

msgid "writing_course_note"
msgstr "<strong>Note:</strong> Writing credit automatically given to all students with a passing grade in this course."

Expand Down Expand Up @@ -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 "<strong>One</strong> grade submitted to the Registrar by <strong>%(submitted_by)s</strong> on %(submitted_date)s."

msgid "grades_submitted_to_registrar"
msgstr "<strong>%(submitted_count)s</strong> grades submitted to the Registrar by <strong>%(submitted_by)s</strong> on %(submitted_date)s."

msgid "change_submitted_grades"
msgstr "Change submitted grades"

Expand Down Expand Up @@ -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 (<strong>SIS User ID</strong> or <strong>StudentNo)</strong> AND"

msgid "required_col_grade"
msgstr "a column for grades to be submitted (<strong>ImportGrade</strong>)"

msgid "missing_header_grade"
msgstr "Missing column heading: &quot;ImportGrade&quot;"

Expand All @@ -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 <strong>%(section_name)s</strong> in this CSV file."

Expand All @@ -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."

Expand All @@ -463,27 +490,9 @@ msgstr "Please select a format to use:"
msgid "import_select_different_file"
msgstr "To select a different file, click <strong>Cancel</strong>."

msgid "import_grade_found"
msgstr "One grade found for <strong>%(section_name)s</strong> in <strong>%(source_name)s</strong>."

msgid "import_grades_found"
msgstr "%(grade_count)s total grades found for <strong>%(section_name)s</strong> in <strong>%(source_name)s</strong>."

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 <strong>{{ override_grade_count }} final grade overrides</strong> 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 <strong>one student with unposted grades</strong> in this Canvas Grade Import."

msgid "import_unposted_grades_found"
msgstr "You have <strong>{{ unposted_grade_count }} students with unposted grades</strong> in this Canvas Grade Import."

msgid "import_unposted_grade_warning"
msgstr "Unposted grades <strong>ARE NOT</strong> represented in the imported final grade."

Expand Down Expand Up @@ -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 <strong>%(quarter)s %(year)s</strong>. 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 <strong>%(quarter)s %(year)s</strong>. If you believe this to be incorrect, please contact your department's Time Schedule Coordinator."
msgstr ""

msgid "import_canvas_btn"
msgstr "Canvas Gradebook"
Expand Down
12 changes: 6 additions & 6 deletions course_grader_vue/components/import/canvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export default {
computed: {
gradesFoundText() {
return interpolate(ngettext(
"import_grade_found",
"import_grades_found",
"One grade found for <strong>%(section_name)s</strong> in <strong>%(source_name)s</strong>.",
"%(grade_count)s total grades found for <strong>%(section_name)s</strong> in <strong>%(source_name)s</strong>.",
this.appState.gradeImport.grade_count), {
section_name: this.section.section_name,
source_name: this.appState.gradeImport.source_name,
Expand All @@ -115,17 +115,17 @@ 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 <strong>%(override_grade_count)s final grade overrides</strong> 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
);
},
unpostedGradesFoundText() {
return interpolate(ngettext(
"import_unposted_grade_found",
"import_unposted_grades_found",
"You have <strong>one student with unposted grades</strong> in this Canvas Grade Import.",
"You have <strong>%(unposted_grade_count)s students with unposted grades</strong> in this Canvas Grade Import.",
this.appState.gradeImport.unposted_grade_count), {
unposted_grade_count: this.appState.gradeImport.unposted_grade_count
}, true
Expand Down
46 changes: 26 additions & 20 deletions course_grader_vue/components/import/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<div v-if="appState.gradeImport.grade_count">
<p>
<i class="fa fa-check-circle text-success" aria-hidden="true"></i>
<strong>{{ appState.gradeImport.grade_count }}</strong> of
<strong>{{ expectedGradeCount }}</strong>
{{ ngettext("grade", "grades", expectedGradeCount) }} found in the file
<strong>{{ file.name }}</strong>
<span v-html="gradesFoundText"></span>
</p>

<ImportConvertSave :section="section" />
Expand All @@ -21,30 +18,28 @@
</div>
<div v-else>
<p>{{ expectedGradeCountText }}</p>
<p>The CSV is required to contain at least two columns:</p>
<p>{{ gettext("csv_required_cols") }}</p>
<ul>
<li>a column for student identifier (<strong>SIS User ID</strong> or <strong>StudentNo)</strong> AND</li>
<li>a column for grades to be submitted (<strong>ImportGrade</strong>)</li>
<li v-html="gettext('required_col_student')"></li>
<li v-html="gettext('required_col_grade')"></li>
</ul>

<p>
An imported CSV file can contain letter grades, grade codes, or
percentages. You will be prompted to
{{ gettext("csv_grade_types") }}
<BLink
href="https://itconnect.uw.edu/learn/tools/gradepage/import-convert-csv/#convert"
title="Learn about converting percentages on IT Connect"
:title="gettext('convert_percentages_help_title')"
v-text="gettext('learn_more')"
target="_blank">
convert percentages
</BLink>
during the import process.
</p>

<p>
<BLink
href="https://itconnect.uw.edu/learn/tools/gradepage/import-convert-csv/"
:title="gettext('format_csv_help_title')"
v-text="gettext('format_csv_help')"
target="_blank">
{{ gettext('format_csv_help') }}
</BLink>
</p>
<p v-html="gettext('begin_csv_import')"></p>
Expand Down Expand Up @@ -105,12 +100,12 @@
</ul>
</div>
<p>
Or,
<BLink
href="https://itconnect.uw.edu/learn/tools/gradepage/assign-submit-grades/"
:title="gettext('import_other_options_title')"
v-text="gettext('import_other_options')"
target="_blank"
>see other options for submitting grades.</BLink>
></BLink>
</p>
</div>
<div v-else-if="appState.gradeImport && !appState.gradeImport.grade_count">
Expand All @@ -119,18 +114,18 @@
<span v-html="import_no_grades_found"></span><br/>
<small>{{ gettext("file_name") }}: <em>{{ file.name }}</em></small>
<ul>
<li>Confirm that the ImportGrade column contains grade values.</li>
<li>Confirm that the SIS User ID or StudentNo column contains student identifiers.</li>
<li>Confirm that the .csv file contains students from this section's roster. </li>
<li v-text="gettext('confirm_grade_column')"></li>
<li v-text="gettext('confirm_student_column')"></li>
<li v-text="gettext('confirm_roster_students')"></li>
<li v-html="gettext('select_different_file')"</li>
</ul>
<p>
Or,
<BLink
href="https://itconnect.uw.edu/learn/tools/gradepage/assign-submit-grades/"
:title="gettext('import_other_options_title')"
v-text="gettext('import_other_options')"
target="_blank"
>see other options for submitting grades.</BLink>
></BLink>
</p>
</div>
</div>
Expand Down Expand Up @@ -217,6 +212,17 @@ export default {
return interpolate(gettext("importing_grades_for_section"),
{section_name: this.section.section_name}, true);
},
gradesFoundText() {
return interpolate(ngettext(
"<strong>%(grade_count)s</strong> of <strong>%(expected_count)s</strong> grade found in the file <strong>%(file_name)s</strong>",
"<strong>%(grade_count)s</strong> of <strong>%(expected_count)s</strong> grades found in the file <strong>%(file_name)s</strong>",
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);
Expand Down
7 changes: 4 additions & 3 deletions course_grader_vue/components/workflow/confirm-grades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
v-if="submission.grade_import.import_conversion"
:value="submission.grade_import.import_conversion"
>
<i class="me-2 text-body-tertiary"></i>Section {{ submission.section_id }}
<i class="me-2 text-body-tertiary"></i>
{{ gettext("section") }} {{ submission.section_id }}
</BDropdownItem>
</BDropdown>
</div>
Expand Down Expand Up @@ -278,8 +279,8 @@ export default {
methods: {
gradesSubmittedText(submission) {
return interpolate(ngettext(
"grade_submitted_to_registrar",
"grades_submitted_to_registrar",
"<strong>One</strong> grade submitted to the Registrar by <strong>%(submitted_by)s</strong> on %(submitted_date)s.",
"<strong>%(submitted_count)s</strong> grades submitted to the Registrar by <strong>%(submitted_by)s</strong> on %(submitted_date)s.",
submission.submitted_count), {
submitted_count: submission.submitted_count,
submitted_by: submission.submitted_by,
Expand Down
10 changes: 5 additions & 5 deletions course_grader_vue/components/workflow/edit-grades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/>
</div>

<SectionHeader :section="section" :title="gettext('enter_grades')" />
<SectionHeader :section="section" :title="$_('enter_grades')" />
</template>

<template v-if="errorResponse">
Expand All @@ -20,10 +20,10 @@
class="mb-2 pb-2 small text-muted border-bottom"
>
<div v-if="appState.graderoster.is_writing_section"
v-html="gettext('writing_course_note')">
v-html="$_('writing_course_note')">
</div>
<div v-if="appState.graderoster.has_duplicate_codes">
{{ gettext("duplicate_code") }}
{{ $_("duplicate_code") }}
<i class="bi bi-circle-fill text-secondary"></i>
</div>
</div>
Expand Down Expand Up @@ -57,13 +57,13 @@
<div class="flex-fill align-self-center text-end me-2 small">
<span v-if="gradesRemainingText">{{ gradesRemainingText }} </span>
<span v-else class="visually-hidden">
{{ gettext("grades_ok_review") }}
{{ $_("grades_ok_review") }}
</span>
</div>
<BButton
:disabled="reviewDisabled"
variant="primary"
v-text="gettext('btn_review_submit')"
v-text="$_('btn_review_submit')"
@click="reviewGrades"
>
</BButton>
Expand Down
8 changes: 4 additions & 4 deletions course_grader_vue/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"
aria-controls="gettingStartedCollapse"
>
<span><i class="bi bi-calendar3 me-3"></i>{{ gettext("previous_terms") }}</span>
<span><i class="bi bi-calendar3 me-3"></i>{{ $_("Previous terms") }}</span>
<i class="bi bi-chevron-right" aria-hidden="true"></i>
</BLink>
<div
Expand Down Expand Up @@ -65,12 +65,12 @@
value="Clear override"
@click="clearUserOverride()"
>
{{ gettext("clear_override") }}
{{ $_("Clear override") }}
</button>
</SProfile>
<SProfile v-else :user-netid="context.login_user">
<a :href="context.signout_url" class="text-white">
{{ gettext("logout") }}
{{ $_("Sign out") }}
</a>
</SProfile>
</template>
Expand All @@ -79,7 +79,7 @@
<div class="bg-secondary bg-opacity-10 rounded-3 p-3">
<div class="mb-2 text-body">
<i class="bi bi-exclamation-triangle-fill me-3"></i>
{{ gettext("grading_period_status") }}
{{ $_("Grading Period Status") }}
</div>
<ul class="list-unstyled m-0 text-body small">
<li
Expand Down
Loading