Skip to content

Commit

Permalink
MDL-70608 lang: Recommend running the scheduled task to update packs
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Feb 19, 2021
1 parent b21d428 commit d83cead
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admin/tool/langimport/classes/output/langimport_page.php
Expand Up @@ -107,6 +107,11 @@ public function export_for_template(renderer_base $output) {
$data->caninstall = true;
}

if (count($this->installedlanguages) > 3) {
$data->hasmanyinstalledlanguages = true;
$data->updatelangstaskname = get_string('updatelangs', 'tool_langimport');
}

return $data;
}
}
1 change: 1 addition & 0 deletions admin/tool/langimport/lang/en/tool_langimport.php
Expand Up @@ -54,4 +54,5 @@
$string['uninstall'] = 'Uninstall selected language pack(s)';
$string['uninstallconfirm'] = 'You are about to completely uninstall these language packs: <strong>{$a}</strong>. Are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
$string['updatelangsnote'] = 'Updating all installed language packs by clicking the button can take a long time and lead to timeouts. It is recommended instead to make use of the scheduled task \'{$a->taskname}\' (which runs by default every day).';
$string['privacy:metadata'] = 'The Language packs plugin does not store any personal data.';
3 changes: 3 additions & 0 deletions admin/tool/langimport/templates/langimport.mustache
Expand Up @@ -88,6 +88,9 @@
<form id="updateform" action="{{updateurl}}" method="post">
<fieldset>
<input type="submit" value="{{#str}}updatelangs, tool_langimport{{/str}}" class="btn btn-secondary">
{{#hasmanyinstalledlanguages}}
<p class="mt-2 small">{{#str}} updatelangsnote, tool_langimport, {"taskname": {{#quote}}{{updatelangstaskname}}{{/quote}} }{{/str}}</p>
{{/hasmanyinstalledlanguages}}
</fieldset>
</form>
</div>
Expand Down

0 comments on commit d83cead

Please sign in to comment.