MDL-76222 tool_customlang: non-translatable export CLI filename.

This matches the name used for manual (via UI) language export.
This commit is contained in:
Paul Holden 2022-11-07 23:00:50 +00:00
parent 0780e87f06
commit 6f4675e043
3 changed files with 5 additions and 2 deletions

View file

@ -88,7 +88,7 @@ if ($options['lang']) {
} }
foreach ($langs as $lang) { foreach ($langs as $lang) {
$filename = $options['target'] . get_string('exportzipfilename', 'tool_customlang', ['lang' => $lang]); $filename = $options['target'] . "customlang_{$lang}.zip";
// If the file exists and we are not using the temp folder it requires an ovewrite. // If the file exists and we are not using the temp folder it requires an ovewrite.
if ($options['target'] != $dafaulttarget && file_exists($filename) && !$options['overwrite']) { if ($options['target'] != $dafaulttarget && file_exists($filename) && !$options['overwrite']) {
cli_problem(get_string('cliexportfileexists', 'tool_customlang', ['lang' => $lang])); cli_problem(get_string('cliexportfileexists', 'tool_customlang', ['lang' => $lang]));

View file

@ -0,0 +1 @@
exportzipfilename,tool_customlang

View file

@ -50,7 +50,6 @@ $string['customlang:export'] = 'Export local translation';
$string['customlang:view'] = 'View local translation'; $string['customlang:view'] = 'View local translation';
$string['export'] = 'Export custom strings'; $string['export'] = 'Export custom strings';
$string['exportfilter'] = 'Select component(s) to export'; $string['exportfilter'] = 'Select component(s) to export';
$string['exportzipfilename'] = 'customlang-export-{$a->lang}.zip';
$string['editlangpack'] = 'Edit language pack'; $string['editlangpack'] = 'Edit language pack';
$string['filter'] = 'Filter strings'; $string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components'; $string['filtercomponent'] = 'Show strings of these components';
@ -92,3 +91,6 @@ $string['pluginname'] = 'Language customisation';
$string['savecheckin'] = 'Save changes to the language pack'; $string['savecheckin'] = 'Save changes to the language pack';
$string['savecontinue'] = 'Apply changes and continue editing'; $string['savecontinue'] = 'Apply changes and continue editing';
$string['privacy:metadata'] = 'The Language customisation plugin does not store any personal data.'; $string['privacy:metadata'] = 'The Language customisation plugin does not store any personal data.';
// Deprecated since Moodle 4.2.
$string['exportzipfilename'] = 'customlang-export-{$a->lang}.zip';