Skip to content

Commit

Permalink
Merge pull request #532 from uw-it-aca/task/lang-refactor
Browse files Browse the repository at this point in the history
drop most lang strings
  • Loading branch information
jlaney authored Nov 6, 2024
2 parents 66e800f + c34db40 commit 595acec
Show file tree
Hide file tree
Showing 24 changed files with 266 additions and 830 deletions.
Binary file modified course_grader/locale/en/LC_MESSAGES/djangojs.mo
Binary file not shown.
579 changes: 0 additions & 579 deletions course_grader/locale/en/LC_MESSAGES/djangojs.po

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions course_grader_vue/components/convert/calculator-row.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<fieldset>
<legend class="visually-hidden">{{ gettext("calculator_legend") }}</legend>
<legend class="visually-hidden">
Relate a Final Score (percentage) to a Grade Point:
</legend>

<div class="d-flex justify-content-between">
<div class="w-50">
Expand All @@ -19,13 +21,13 @@
</div>
<label for="`calculator-percentage-${index}`">
<span v-if="last" class="visually-hidden">
{{ gettext("calculator_perc_label_lower") }}
Lower Limit: Final Score (percentage)
</span>
<span v-else-if="first" class="visually-hidden">
{{ gettext("calculator_perc_label_upper") }}
Upper Limit: Final Score (percentage)
</span>
<span v-else class="visually-hidden">
{{ gettext("calculator_perc_label") }}
Final Score (percentage)
</span>
<span role="alert" class="text-danger invalid-grade small">
{{ rowData.percentageError }}
Expand All @@ -45,13 +47,13 @@
/>
<label for="`calculator-grade-${index}`">
<span v-if="last" class="visually-hidden">
{{ gettext("calculator_grade_label_lower") }}
Lower Limit: Grade Point
</span>
<span v-else-if="first" class="visually-hidden">
{{ gettext("calculator_grade_label_upper") }}
Upper Limit: Grade Point
</span>
<span v-else class="visually-hidden">
{{ gettext("calculator_grade_label") }}
Lower Limit: Grade Point
</span>
<span role="alert" class="text-danger invalid-grade small">
{{ rowData.gradeError }}
Expand Down
43 changes: 20 additions & 23 deletions course_grader_vue/components/convert/calculator.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<label for="import-scale-selector" class="visually-hidden">
{{ gettext("conversion_scale_chooser_label") }}
Choose your grade scale:
</label>
<BDropdown
id="import-scale-selector"
Expand All @@ -23,26 +23,24 @@

<div class="col-7 bg-body-tertiary p-3">
<div v-if="!calculatorStore.isFixedScale">
<h4 class="" id="grade_conversion_header">
{{ gettext("calculator_header") }}
</h4>
<p class="">{{ gettext("calculator_instructions") }}</p>
<h4 id="grade_conversion_header">Grade conversion calculator</h4>
<p>
Set at least two Percentage to Grade Point conversion points and click <strong>Apply</strong> to create the full Grade Scale below.
</p>

<div class="d-flex justify-content-between">
<div class="fw-bold">{{ gettext("calculator_perc_label_vis") }}</div>
<div class="fw-bold">{{ gettext("calculator_grade_label") }}</div>
<div class="fw-bold">Final Score</div>
<div class="fw-bold">Grade Point</div>
</div>

<ol class="list-unstyled">
<li v-for="(data, index) in calculatorValues" :key="index">
<div v-if="index === calculatorValues.length - 1">
<BLink
@click.prevent="calculatorStore.addCalculatorRow()"
:title="gettext('calculator_addrow_title')"
title="Add a row to the conversion table. Leave unused rows blank."
tabindex="0"
>
{{ gettext("calculator_addrow") }}
</BLink>
>+ Add a row</BLink>
<span class="pull-right" style="margin-right: 3em">
<i class="fa fa-ellipsis-v fa-lg"></i>
</span>
Expand All @@ -59,17 +57,16 @@
<div class="my-5">
<span>
<BLink
:title="gettext('calculator_reset_title')"
title="Reset the grade conversion calculator"
@click.prevent="calculatorStore.resetCalculatorValues()"
>{{ gettext("reset") }}
</BLink>
>Reset</BLink>
</span>
<span>
<BButton
:title="gettext('calculator_apply_title')"
title="Create grade scale"
@click="calculatorStore.calculateScale()"
>
<i class="fa fa-angle-double-down fa-lg"></i> {{ gettext("apply") }}
<i class="fa fa-angle-double-down fa-lg"></i> Apply
</BButton>
</span>
</div>
Expand All @@ -86,16 +83,16 @@
aria-labelledby="grade_scale_header"
>
<h4 class="visually-hidden" id="grade_scale_header">
{{ gettext("grade_scale_header") }}
Grade Scale:
</h4>

<div class="d-flex justify-content-between">
<div class="fw-bold">{{ gettext("grade_scale_grade_label_vis") }}</div>
<div class="fw-bold">{{ gettext("calculator_grade_label") }}</div>
<div class="fw-bold">Minimum score for class grade</div>
<div class="fw-bold">Grade Point</div>
</div>

<ol
:aria-label="gettext('grade_scale_list_label_sr')"
aria-label="Review and adjust Grade Scale:"
class="list-unstyled"
>
<li v-for="(data, index) in scaleValues" :key="index">
Expand All @@ -107,9 +104,9 @@
</li>
</ol>
<span>
<BButton @click.prevent="calculatorStore.resetScaleValues()">{{
gettext("grade_scale_clear")
}}</BButton>
<BButton
@click.prevent="calculatorStore.resetScaleValues()"
>Clear scale</BButton>
</span>
</div>
</div>
Expand Down
20 changes: 15 additions & 5 deletions course_grader_vue/components/convert/grade-scale-row.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
</div>

<div v-if="last">
<span class="visually-hidden">
{{ gettext("grade_scale_limit_pre") }} {{ lastMinPercentage }}
{{ gettext("grade_scale_limit_post") }} {{ rowData.grade }}.
</span>
<span class="visually-hidden">{{ gradeScaleLimitText }}</span>
<span> {{ lastMinPercentage }} </span>
</div>
<div v-else>
Expand All @@ -21,7 +18,7 @@
class="form-control"
name="min-percentage"
:value="rowData.minPercentage"
:title="gettext('grade_scale_input_title') + rowData.grade"
:title="gradeScaleTitle"
@change="minPercentageChanged($event.target.value)"
required
aria-describedby="percent-addon2"
Expand Down Expand Up @@ -79,6 +76,19 @@ export default {
this.calculatorStore.scaleValues.length - 2
].minPercentage;
},
gradeScaleLimitText() {
return interpolate(
"Any final grade below a %(min_percentage)s% will result in a %(grade)s.",
{
min_percentage: this.lastMinPercentage,
grade: this.rowData.grade
}, true
);
},
gradeScaleTitle() {
return interpolate(
"Minimum percentage that will result in a %(grade)s", this.rowData, true);
},
},
methods: {
minPercentageChanged: function (value) {
Expand Down
2 changes: 1 addition & 1 deletion course_grader_vue/components/grade/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</span>
</span>
{{ student.imported_grade }}%
<span class="visually-hidden">{{ gettext("conversion_confirm_grade_text") }}</span>
<span class="visually-hidden">converted to</span>
<i class="fas fa-long-arrow-alt-right"></i>
<strong>{{ student.converted_grade }}</strong>
</div>
Expand Down
38 changes: 21 additions & 17 deletions course_grader_vue/components/grade/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@

<!-- grade text input - custom bootstrap -->
<div class="dropdown ms-1">
<label :for="`grade-${student.item_id}`" class="visually-hidden"
>{{ gettext("enter_grade") }}</label
>
<label
:for="`grade-${student.item_id}`"
class="visually-hidden"
>Enter grade
</label>
<input
class="form-control form-control-sm rounded-2 dropdown-toggle border-secondary"
type="text"
Expand Down Expand Up @@ -97,7 +99,7 @@
</div>

<div v-if="incomplete" class="text-start small mb-3 text-muted">
{{ gettext("default_grade") }}
Student will receive default grade
</div>

<div>
Expand All @@ -106,7 +108,7 @@
<span
v-if="student.is_override_grade"
class="override-icon"
:title="gettext('override_grade_title')"
title="Override grade imported from Canvas Gradebook"
>
<i class="fas fa-circle fa-stack-2x" aria-hidden="true"></i>
</span>
Expand Down Expand Up @@ -156,20 +158,22 @@ export default {
return this.incomplete ? "Enter default grade..." : "Enter grade...";
},
inputIncompleteTitle() {
return this.student.allows_incomplete
? ""
: "Incomplete not allowed for " +
this.student.student_firstname +
" " +
this.student.student_lastname;
return interpolate(this.student.allows_incomplete
? this.incomplete
? "Click to remove Incomplete for %(student_firstname)s %(student_lastname)s"
: "Click to assign Incomplete for %(student_firstname)s %(student_lastname)s"
: "Incomplete not allowed for %(student_firstname)s %(student_lastname)s",
this.student, true
);
},
inputWritingTitle() {
return this.student.allows_writing_credit
? ""
: "Writing Credit not allowed for " +
this.student.student_firstname +
" " +
this.student.student_lastname;
return interpolate(this.student.allows_writing_credit
? this.writing
? "Click to remove Writing Credit for %(student_firstname)s %(student_lastname)s"
: "Click to assign Writing Credit for %(student_firstname)s %(student_lastname)s"
: "Writing Credit not allowed for %(student_firstname)s %(student_lastname)s",
this.student, true
);
},
},
methods: {
Expand Down
22 changes: 12 additions & 10 deletions course_grader_vue/components/grade/static.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
<template>
<template v-if="student.is_auditor">
<span class="text-uppercase fs-5 fw-bold">{{ gettext("auditor") }}</span>
<span class="text-uppercase fs-5 fw-bold">Auditor</span>
</template>
<template v-else-if="student.is_withdrawn">
<div class="text-uppercase fs-5 fw-bold">
<span v-if="student.withdrawn_week">
{{ interpolate(gettext("withdrawn_week %(withdrawn_week)s"), student, true) }}
Withdrawn (week {{ student.withdrawn_week }})
</span>
<span v-else>{{ gettext("withdrawn") }}</span>
<span v-else>Withdrawn</span>
</div>
</template>
<template v-else>
<span v-if="student.has_writing_credit" class="me-2">
<abbr title="Writing credit">W</abbr>
</span>
<template v-if="student.has_incomplete">
<span class="visually-hidden">{{ gettext("submitted_grade") }}:</span>
<span class="visually-hidden">Submitted grade:</span>
<span class="fs-2 fw-bold">I</span>
<div class="small text-muted">(Incomplete) Default: {{ student.grade }}</div>
<div class="small text-muted">
(Incomplete) Default: {{ student.grade }}
</div>
</template>
<template v-else>
<template v-if="student.no_grade_now">
<span class="visually-hidden">{{ gettext("submitted_grade") }}:</span>
<span class="visually-hidden">Submitted grade:</span>
<span class="fs-2 fw-bold">X</span>
<div class="small text-muted">{{ gettext("no_grade_now") }}</div>
<div class="small text-muted">(No grade now)</div>
</template>
<template v-else>
<span class="visually-hidden">{{ gettext("submitted_grade") }}:</span>
<span class="visually-hidden">Submitted grade:</span>
<span class="fs-2 fw-bold">{{ student.grade }}</span>
</template>
</template>
<div v-if="student.date_graded && showDateGraded" class="small text-muted">
{{ interpolate(gettext("grade_submitted %(date_graded)s"), student, true) }}
Submitted {{ student.date_graded }}
</div>
<div v-if="student.grade_status" class="small text-muted">
{{ interpolate(gettext("grade_submitted_status %(grade_status)s"), student, true) }}
Submitted with error: {{ student.grade_status }}
</div>
</template>
</template>
Expand Down
26 changes: 12 additions & 14 deletions course_grader_vue/components/import/canvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<div v-else-if="appState.gradeImport">
<div v-if="appState.gradeImport.status_code != 200">
{{ gettext("import_canvas_error") }}
There was an error importing grades from Canvas
({{ appState.gradeImport.status_code }}).
</div>
<div v-else-if="appState.gradeImport.grade_count">
Expand All @@ -24,31 +24,33 @@
<span v-html="overrideGradesFoundText"></span>
<BLink
target="_blank"
:title="gettext('import_override_grades_title')"
v-text="gettext('learn_more')"
href="https://itconnect.uw.edu/learn/tools/canvas/canvas-help-for-instructors/assignments-grading/new-gradebook/final-grade-override/">
title="Learn more about importing grade overrides on IT Connect"
href="https://itconnect.uw.edu/learn/tools/canvas/canvas-help-for-instructors/assignments-grading/new-gradebook/final-grade-override/">Learn more
</BLink>.
</p>
</div>

<div v-if="appState.gradeImport.unposted_grade_count" role="alert" class="alert alert-danger">
<i class="fas fa-exclamation-circle fa-2x" aria-hidden="true"></i>
<p v-html="unpostedGradesFoundText"></p>
<span v-html="gettext('import_unposted_grade_warning')"></span>
<span>
Unposted grades <strong>ARE NOT</strong> represented in the imported final grade.
</span>
<BLink
target="_blank"
:title="gettext('import_unposted_grade_title')"
v-text="gettext('learn_more')"
href="https://itconnect.uw.edu/learn/tools/canvas/canvas-help-for-instructors/assignments-grading/correctly-import-grades/">
title="Learn more about importing Canvas grades on IT Connect"
href="https://itconnect.uw.edu/learn/tools/canvas/canvas-help-for-instructors/assignments-grading/correctly-import-grades/">Learn more
</BLink>.
</div>

<ImportConvertSave :section="section" />

</div>
<div v-else>
<span v-html="noGradesFoundText"></span>
{{ gettext("select_alternate_import") }}
<span>
No grades found for <strong>{{ section.section_name }}</strong> in Canvas.
</span>
Select a different option for import or enter grades manually.
</div>
</div>
</template>
Expand Down Expand Up @@ -109,10 +111,6 @@ export default {
}, true
);
},
noGradesFoundText() {
return interpolate(gettext("no_grades_found_canvas"),
{section_name: this.section.section_name}, true);
},
overrideGradesFoundText() {
return interpolate(ngettext(
"You have one final grade override in this Canvas Grade Import. This grade WILL BE included in the imported grades.",
Expand Down
Loading

0 comments on commit 595acec

Please sign in to comment.