MDL-80344 calendar: correct no subscriptions language string use.

Ensure expected parameters are present; avoid string concatenation.
This commit is contained in:
Paul Holden
2024-06-05 15:52:23 +01:00
parent 11a2641a13
commit f537f9c067
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -351,9 +351,8 @@ class core_calendar_renderer extends plugin_renderer_base {
*/
public function render_no_calendar_subscriptions(): string {
$output = html_writer::start_div('mt-5');
$importlink = html_writer::link((new moodle_url('/calendar/import.php', calendar_get_export_import_link_params()))->out(),
get_string('importcalendarexternal', 'calendar'));
$output .= get_string('nocalendarsubscriptions', 'calendar', $importlink);
$importlink = (new moodle_url('/calendar/import.php', calendar_get_export_import_link_params()))->out();
$output .= get_string('nocalendarsubscriptionsimportexternal', 'core_calendar', $importlink);
$output .= html_writer::end_div();
return $output;
@@ -380,7 +379,8 @@ class core_calendar_renderer extends plugin_renderer_base {
$table->id = 'subscription_details_table';
if (empty($subscriptions)) {
$cell = new html_table_cell(get_string('nocalendarsubscriptions', 'calendar'));
$importlink = (new moodle_url('/calendar/import.php', calendar_get_export_import_link_params()))->out();
$cell = new html_table_cell(get_string('nocalendarsubscriptionsimportexternal', 'core_calendar', $importlink));
$cell->colspan = 5;
$table->data[] = new html_table_row(array($cell));
}
+1
View File
@@ -193,6 +193,7 @@ $string['namewithsource'] = '{$a->name} ({$a->source})';
$string['never'] = 'Never';
$string['newevent'] = 'New event';
$string['newmonthannouncement'] = 'Calendar is now set to {$a}.';
$string['nocalendarsubscriptionsimportexternal'] = 'No calendar subscriptions yet. <a href="{$a}">Import an external calendar</a>';
$string['notitle'] = 'no title';
$string['noupcomingevents'] = 'There are no upcoming events';
$string['nocalendarsubscriptions'] = 'No calendar subscriptions yet. Do you want to {$a}';