Skip to content

Commit 65771a1

Browse files
committed
Update language strings (MDL-80461)
1 parent 26fe1a2 commit 65771a1

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

classes/output/courseformat/content/addsection.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ protected function get_add_section_data(\renderer_base $output, int $lastsection
7676
$course = $format->get_course();
7777
$data = parent::get_add_section_data($output, $lastsection, $maxsections);
7878

79-
if (get_string_manager()->string_exists('addsectiontopic', 'format_' . $course->format)) {
80-
$addstring = get_string('addsectiontopic', 'format_' . $course->format);
81-
} else {
82-
$addstring = get_string('addsections');
83-
}
79+
$addstring = get_string_manager()->string_exists('addsectiontopic', 'format_' . $course->format) ?
80+
get_string('addsectiontopic', 'format_' . $course->format)
81+
: get_string('addsection', 'core_courseformat');
8482

8583
$params = [
8684
'courseid' => $course->id, // CHANGED.

classes/output/courseformat/contenttabs/tabtreecontainer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ public function export_tab_for_template(
194194
preg_match('/^add(\d+)$/', $sectionextra, $matches);
195195
$parentid = $matches[1];
196196
$straddsection = get_string_manager()->string_exists('addsectionpage', 'format_' . $course->format) ?
197-
get_string('addsectionpage', 'format_' . $course->format) : get_string('addsections');
197+
get_string('addsectionpage', 'format_' . $course->format)
198+
: get_string('addsection', 'core_courseformat');
198199
$params = [
199200
'courseid' => $course->id,
200201
'increase' => true,

lang/en/format_multitopic.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2626
*/
2727

28+
// The following language strings are used from core, which need consistent translations here:
29+
// editsectionname, hiddensections, newsectionname, sectionoutline, topic, numweeks, week.
30+
2831
$string['addsectionpage'] = 'Add page';
2932
$string['addsectiontopic'] = 'Add topic';
3033

@@ -43,7 +46,7 @@
4346
$string['collapsibleoverride_help'] = 'Whether this topic is collapsible.
4447
(Not applicable to pages.)';
4548

46-
$string['currentsection'] = 'This section';
49+
$string['currentsection'] = 'Current section';
4750

4851
$string['image'] = 'Image';
4952
$string['image_by'] = 'by';
@@ -74,13 +77,10 @@
7477

7578
$string['plugin_description'] = 'Topics are displayed in tabbed pages,
7679
with multiple collapsible topics available on each page.';
77-
$string['pluginname'] = 'Multitopic format';
80+
$string['pluginname'] = 'Multitopic';
7881
$string['privacy:metadata'] = 'The Multitopic format plugin does not store any personal data.';
79-
$string['section0name'] = 'General';
8082
$string['sectionname'] = 'Section';
8183

82-
$string['sectionoutline'] = 'Section outline';
83-
8484
$string['weeks_abbreviation'] = 'W';
8585
$string['weeks_capitalised'] = 'Weeks';
8686
$string['weeks_mindays'] = 'First week minimum days of year';
@@ -100,3 +100,7 @@
100100
$string['move_to_next_page'] = 'Move to next page';
101101
$string['move_to_prev_page'] = 'Move to previous page';
102102
$string['showfromothers'] = 'Show';
103+
104+
// Deprecated since Multitopic v5.1.
105+
$string['section0name'] = 'General';
106+
$string['sectionoutline'] = 'Section outline';

lib.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ public function get_max_sections(): int {
150150
* @return string the page title
151151
*/
152152
public function page_title(): string {
153-
return get_string_manager()->string_exists('sectionoutline', 'format_multitopic') ?
154-
get_string('sectionoutline', 'format_multitopic') : get_string('topicoutline');
153+
return get_string('sectionoutline');
155154
}
156155

157156
/**
@@ -536,7 +535,7 @@ public function get_section_short_name($section): string {
536535
public function get_default_section_name($section): string {
537536
if ($section->section == 0) {
538537
// Return the general section.
539-
return get_string('section0name', 'format_multitopic');
538+
return get_string('section0name', 'format_topics');
540539
} else {
541540
// Use course_format::get_default_section_name implementation which
542541
// will display the section name in "Section n" format.
@@ -571,6 +570,15 @@ public function get_section_subtitle($section): string {
571570
}
572571
// END ADDED.
573572

573+
/**
574+
* Returns the name for the highlighted section.
575+
*
576+
* @return string The name for the highlighted section based on the given course format.
577+
*/
578+
public function get_section_highlighted_name(): string {
579+
return get_string('currentsection', 'format_multitopic');
580+
}
581+
574582
/**
575583
* Set if the current format instance will show all pages or an individual one.
576584
*
@@ -1405,16 +1413,7 @@ public function inplace_editable_render_section_name(
14051413
$edithint = null,
14061414
$editlabel = null
14071415
): \core\output\inplace_editable {
1408-
if (empty($edithint)) {
1409-
$edithint = new lang_string('editsectionname'); // CHANGED.
1410-
}
1411-
if (empty($editlabel)) {
1412-
$title = get_section_name($section->course, $section);
1413-
$editlabel = new lang_string('newsectionname', '', $title); // CHANGED.
1414-
}
1415-
1416-
// REMOVED function call.
1417-
// INCLUDED instead /course/format/classes/base.php function inplace_editable_render_section_name body.
1416+
// INCLUDED /course/format/classes/base.php function inplace_editable_render_section_name body.
14181417
global $USER, $CFG;
14191418
require_once($CFG->dirroot . '/course/lib.php');
14201419

0 commit comments

Comments
 (0)