From e2b4a7d387d67bf1ff233ae092177e5146b413d6 Mon Sep 17 00:00:00 2001 From: Stefan Hanauska Date: Sun, 2 Nov 2025 16:59:44 +0100 Subject: [PATCH] Move hardcoded strings --- lang/en/moodleoverflow.php | 4 ++++ templates/forum_list.mustache | 10 +++++----- userstats.php | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lang/en/moodleoverflow.php b/lang/en/moodleoverflow.php index 9e2371ec9c..8bb130628d 100644 --- a/lang/en/moodleoverflow.php +++ b/lang/en/moodleoverflow.php @@ -250,6 +250,7 @@ $string['noguestpost'] = 'Sorry, guests are not allowed to post.'; $string['noguesttracking'] = 'Sorry, guests are not allowed to set tracking options.'; $string['noonecansubscribenow'] = 'Subscriptions are now disallowed'; +$string['nootherforums'] = 'Unfortunately, there is no other Moodleoverflow where you can move it.'; $string['nopermissiontosubscribe'] = 'You do not have the permission to view subscribers'; $string['nopostmoodleoverflow'] = 'Sorry, you are not allowed to post to this forum.'; $string['noratemoodleoverflow'] = 'Sorry, you are not allowed to vote in this forum.'; @@ -421,6 +422,8 @@ $string['unsubscribelink'] = 'Unsubscribe from this forum: {$a}'; $string['updategrades'] = 'Update grades'; $string['upvotenotchangeable'] = 'Cannot upvote'; +$string['userstats'] = 'User statistics'; +$string['userstatscourse'] = 'User statistics of course: {$a}'; $string['userstatscourseactivity'] = 'Activity (coursewide)'; $string['userstatscoursereputation'] = 'Reputation (coursewide)'; $string['userstatsdownvotes'] = 'Received downvotes'; @@ -432,6 +435,7 @@ $string['votescalesolved'] = 'Reputation: Solution'; $string['votescaleupvote'] = 'Reputation: Upvote'; $string['votescalevote'] = 'Reputation: Vote.'; +$string['wheremovetopic'] = 'Where do you want to move the topic "{$a}"?'; $string['wronginteraction'] = 'Something went wrong executing the interaction.'; $string['wrongparametercount'] = 'Exactly one parameter should be declared in the url. Please specify the one action you want to perform.'; $string['your_post_was_rejected'] = 'Your post was rejected.'; diff --git a/templates/forum_list.mustache b/templates/forum_list.mustache index 8bd6109f00..fd93d1f61d 100644 --- a/templates/forum_list.mustache +++ b/templates/forum_list.mustache @@ -15,10 +15,10 @@ along with Moodle. If not, see . }} {{! - @template mod_moodleoverflow/discussion_list + @template mod_moodleoverflow/forum_list - Moodleoverflow discussion_list template. - The purpose of this template is to render a list of discussions for the view.php. + Moodleoverflow forum_list template. + The purpose of this template is to render a list of forums for the view.php. Example context (json): { @@ -29,7 +29,7 @@ {{#currentdiscussion}} - Where do you want to move the topic "{{currentdiscussion}}" ? + {{#str}} wheremovetopic, mod_moodleoverflow, {{currentdiscussion}} {{/str}} {{/currentdiscussion}} @@ -52,7 +52,7 @@ {{/hasforums}} {{^hasforums}}
- Unfortunately, there is no other Moodleoverflow where you can move it. + {{#str}} nootherforums, mod_moodleoverflow {{/str}}
{{/hasforums}}
\ No newline at end of file diff --git a/userstats.php b/userstats.php index be4922b526..4b6efda015 100644 --- a/userstats.php +++ b/userstats.php @@ -58,8 +58,8 @@ // Print the page header. $PAGE->set_url('/mod/moodleoverflow/userstats.php', ['id' => $cm->id, 'courseid' => $course->id, 'mid' => $moodleoverflow->id, ]); - $PAGE->set_title(format_string('User statistics')); - $PAGE->set_heading(format_string('User statistics of course: ' . $course->fullname)); + $PAGE->set_title(get_string('userstats', 'moodleoverflow')); + $PAGE->set_heading(get_string('userstatscourse', 'moodleoverflow', $course->fullname)); // Output starts here. echo $OUTPUT->header();