Skip to content

Commit

Permalink
Merge pull request #21 from ild-thl/7-hard-coded-german-strings
Browse files Browse the repository at this point in the history
Fix #7 hard coded german strings
  • Loading branch information
alominty committed Jul 25, 2024
2 parents a3a9065 + 43b1876 commit 8f7f796
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions block_disealytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public function get_content(): stdClass {

// TODO: Rework this? Workaround to errors happening when index.php is viewed without being logged in.
if (!isloggedin()) {
$this->content->text = 'Bitte melden Sie sich an, um das DiSEA Dashboard benutzten zu können.';
$this->content->text = get_string('login_alert', 'block_disealytics');
return $this->content;
}

if (!str_contains($this->page->pagetype, 'course-view-')) {
$this->content->text = 'Das DiSEA Dashboard kann nur auf der Kurshauptseite angezeigt werden.';
$this->content->text = get_string('course_alert', 'block_disealytics');
return $this->content;
}

Expand Down
3 changes: 2 additions & 1 deletion classes/data/assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ public function block_disealytics_gen_submission_status(): int {
* self::GRADE_STATUS_NEUTRAL if the grade status is neutral.
*
* @throws dml_exception
* @throws coding_exception
*/
public function block_disealytics_gen_grade_status(): int {
switch ($this->block_disealytics_get_gradetype()) {
Expand All @@ -507,7 +508,7 @@ public function block_disealytics_gen_grade_status(): int {
if ($this->gradegrade) {
$coursescale = $DB->get_record("scale", ['id' => $this->gradegrade->rawscaleid]);
}
if ($coursescale && $coursescale->scale == 'nicht bestanden, Nacharbeit, bestanden') {
if ($coursescale && $coursescale->scale == get_string('assignment_view_specific_scale', 'block_disealytics')) {
if ($this->block_disealytics_has_grade()) {
switch ($this->block_disealytics_get_grade()) {
case 1:
Expand Down
1 change: 0 additions & 1 deletion classes/data/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public static function get_all_courses_of_user_current_semester(int $userid): ar
*/
public static function get_all_courses_of_user(int $userid): array {
global $DB;
// Left Join, falls es keine zugeordnete kategorie/Semester gibt.
$sql = "SELECT c.instanceid AS courseid, cr.fullname AS coursename, cat.name AS categoryname, cr.enddate AS coursetimestamp
FROM {context} c
JOIN {role_assignments} ra ON c.id = ra.contextid
Expand Down
3 changes: 3 additions & 0 deletions lang/de/block_disealytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
$string['disealytics:addinstance'] = 'Füge einen neuen DiSEA Dashboard Block hinzu.';
$string['disealytics:myaddinstance'] = 'Füge einen neuen DiSEA Dashboard Block zu meinem Dashboard hinzu.';
$string['languagesetting'] = 'de';
$string['login_alert'] = 'Bitte melden Sie sich an, um das DiSEA Dashboard benutzten zu können.';
$string['course_alert'] = 'Das DiSEA Dashboard kann nur auf der Kurshauptseite angezeigt werden.';
$string['consent_start_msg'] = 'Um das Plugin nutzen zu können, müssen Sie der Datenverarbeitung zustimmen.';
$string['consent_start_btn'] = 'Einwilligen und Dashboard nutzen';
$string['change-to-expandable-view'] = 'Zur Detailansicht ...';
Expand Down Expand Up @@ -108,6 +110,7 @@
$string['assignment_view_hover_selfcheck'] = 'Aufgabe wurde als erledigt markiert, ist ggf. aber noch vom Lehrenden zu prüfen';
$string['assignment_view_hover_neutral'] = 'Neutraler Status. Es besteht kein Handlungsbedarf';
$string['assignment_view_load-less-assignments'] = 'Weniger anzeigen';
$string['assignment_view_specific_scale'] = 'nicht bestanden, Nacharbeit, bestanden';

// Learninggoals view.
$string['learning-goals-view'] = 'Lernziele';
Expand Down
3 changes: 3 additions & 0 deletions lang/en/block_disealytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
$string['disealytics:addinstance'] = 'Add a new DiSEA Dashboard block.';
$string['disealytics:myaddinstance'] = 'Add a new DiSEA Dashboard block to my dashboard.';
$string['languagesetting'] = 'en';
$string['login_alert'] = 'Please log in to use the DiSEA Dashboard.';
$string['course_alert'] = 'The DiSEA Dashboard can only be displayed on the main course page.';
$string['consent_start_msg'] = 'Please consent to data processing in order to use the plugin.';
$string['consent_start_btn'] = 'Consent and use plugin';
$string['change-to-expandable-view'] = 'Go to the detail view ...';
Expand Down Expand Up @@ -108,6 +110,7 @@
$string['assignment_view_hover_selfcheck'] = 'Assignment has been self-marked as completed, but may still need to be reviewed by the instructor';
$string['assignment_view_hover_neutral'] = 'Neutral status. No action is required';
$string['assignment_view_load-less-assignments'] = 'Show less';
$string['assignment_view_specific_scale'] = 'failed, rework, passed';

// Learninggoals view.
$string['learning-goals-view'] = 'Learning Goals';
Expand Down

0 comments on commit 8f7f796

Please sign in to comment.