Skip to content

Commit

Permalink
Issue #3119278 by nterbogt, hansfn: Better messaging for locale batches
Browse files Browse the repository at this point in the history
(cherry picked from commit a5be0a12c5f4c3fcf572d5951cb5bcd70e330b4a)
  • Loading branch information
catch committed Apr 20, 2020
1 parent 6d372bc commit fcaa7b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/locale/locale.batch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function locale_translation_batch_status_check($project, $langcode, array $optio
if ($failure && !$checked) {
$context['results']['failed_files'][] = $source->name;
}
$context['message'] = t('Checked translation for %project.', ['%project' => $source->project]);
$context['message'] = t('Checked %langcode translation for %project.', ['%langcode' => $langcode, '%project' => $source->project]);
}

/**
Expand Down Expand Up @@ -146,7 +146,7 @@ function locale_translation_batch_fetch_download($project, $langcode, &$context)
$source = $sources[$project][$langcode];
if (isset($source->type) && $source->type == LOCALE_TRANSLATION_REMOTE) {
if ($file = locale_translation_download_source($source->files[LOCALE_TRANSLATION_REMOTE], 'translations://')) {
$context['message'] = t('Downloaded translation for %project.', ['%project' => $source->project]);
$context['message'] = t('Downloaded %langcode translation for %project.', ['%langcode' => $langcode, '%project' => $source->project]);
locale_translation_status_save($source->name, $source->langcode, LOCALE_TRANSLATION_LOCAL, $file);
}
else {
Expand Down Expand Up @@ -183,7 +183,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$
$file = $source->files[LOCALE_TRANSLATION_LOCAL];
module_load_include('bulk.inc', 'locale');
$options += [
'message' => t('Importing translation for %project.', ['%project' => $source->project]),
'message' => t('Importing %langcode translation for %project.', ['%langcode' => $langcode, '%project' => $source->project]),
];
// Import the translation file. For large files the batch operations is
// progressive and will be called repeatedly until finished.
Expand All @@ -193,7 +193,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$
if (isset($context['finished']) && $context['finished'] == 1) {
// The import is successful.
if (isset($context['results']['files'][$file->uri])) {
$context['message'] = t('Imported translation for %project.', ['%project' => $source->project]);
$context['message'] = t('Imported %langcode translation for %project.', ['%langcode' => $langcode, '%project' => $source->project]);

// Save the data of imported source into the {locale_file} table and
// update the current translation status.
Expand Down

0 comments on commit fcaa7b5

Please sign in to comment.