diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index ea7e0b9..41679d9 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -29,6 +29,7 @@ * @see locale_translation_batch_status_compare() */ function locale_translation_batch_status_fetch_remote($source, &$context) { + $t = get_t(); // Check the translation file at the remote server and update the source // data with the remote status. if (isset($source->files[LOCALE_TRANSLATION_REMOTE])) { @@ -53,6 +54,7 @@ function locale_translation_batch_status_fetch_remote($source, &$context) { $context['results']['failed_files'][] = $source->name; } $context['results']['sources'][$source->name][$source->langcode] = $source; + $context['message'] = $t('Checked translation file: %name.', array('%name' => $source->name)); } } @@ -73,6 +75,7 @@ function locale_translation_batch_status_fetch_remote($source, &$context) { * @see locale_translation_batch_status_compare() */ function locale_translation_batch_status_fetch_local($sources, &$context) { + $t = get_t(); // Get the status of local translation files and store the result data in the // batch results for later processing. foreach ($sources as $source) { @@ -90,6 +93,7 @@ function locale_translation_batch_status_fetch_local($sources, &$context) { $context['results']['sources'][$source->name][$source->langcode] = $source; } } + $context['message'] = $t('Checked translation files.'); } /** @@ -244,7 +248,7 @@ function locale_translation_batch_fetch_download($project, $langcode, &$context) if (isset($source->type) && $source->type == LOCALE_TRANSLATION_REMOTE) { $t = get_t(); if ($file = locale_translation_download_source($source->files[LOCALE_TRANSLATION_REMOTE])) { - $context['message'] = $t('Importing: %name.', array('%name' => $file->filename)); + $context['message'] = $t('Imported translation file: %name.', array('%name' => $file->filename)); $source->files[LOCALE_TRANSLATION_DOWNLOADED] = $file; } else { @@ -304,7 +308,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ $file = $source_result->files[$import_type]; module_load_include('bulk.inc', 'locale'); $options += array( - 'message' => 'Importing: ' . $file->filename, + 'message' => $t('Importing translation file: %name', array('%name' => $file->filename)), ); // Import the translation file. For large files the batch operations is // progressive and will be called repeatedly untill finished. @@ -314,7 +318,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ if (isset($context['finished']) && $context['finished'] == 1) { // The import is successfull. if (isset($context['results']['files'][$file->uri])) { - $context['message'] = $t('Imported: %name.', array('%name' => $file->filename)); + $context['message'] = $t('Imported translation file: %name.', array('%name' => $file->filename)); // Keep the data of imported source. In the following batch // operation it will be saved in the {locale_file} table. @@ -378,6 +382,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$ * @see locale_translation_batch_status_compare() */ function locale_translation_batch_fetch_update_status(&$context) { + $t = get_t(); $results = array(); if (isset($context['results']['sources'])) { @@ -402,6 +407,7 @@ function locale_translation_batch_fetch_update_status(&$context) { $context['results']['sources'][$project][$langcode] = $source; } } + $context['message'] = $t('Updated translations.'); } } diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 46c5453..385f38f 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -411,10 +411,10 @@ function locale_translate_batch_import($file, $options, &$context) { // http://drupal.org/node/1089472 $context['finished'] = min(0.95, $report['seek'] / filesize($file->uri)); if (isset($options['message'])) { - $context['message'] = t('@message (@percent%)', array('@message' => $options['message'], '@percent' => (int) ($context['finished'] * 100))); + $context['message'] = t('@message (@percent%).', array('@message' => $options['message'], '@percent' => (int) ($context['finished'] * 100))); } else { - $context['message'] = t('Importing file: %filename (@percent%)', array('%filename' => $file->filename, '@percent' => (int) ($context['finished'] * 100))); + $context['message'] = t('Importing translation file: %filename (@percent%).', array('%filename' => $file->filename, '@percent' => (int) ($context['finished'] * 100))); } } else { diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 0dc9bd8..dc998fb 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -297,6 +297,7 @@ function locale_translation_check_projects_batch($projects = array(), $langcodes * Batch definition array. */ function locale_translation_batch_status_build($projects = array(), $langcodes = array()) { + $t = get_t(); $projects = $projects ? $projects : array_keys(locale_translation_get_projects()); $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); @@ -304,9 +305,9 @@ function locale_translation_batch_status_build($projects = array(), $langcodes = $batch = array( 'operations' => $operations, - 'title' => t('Checking available translations'), + 'title' => $t('Checking translations'), 'finished' => 'locale_translation_batch_status_finished', - 'error_message' => t('Error checking available interface translation updates.'), + 'error_message' => $t('Error checking translation updates.'), 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', ); return $batch; diff --git a/core/modules/locale/locale.fetch.inc b/core/modules/locale/locale.fetch.inc index b65aa4b..7542086 100755 --- a/core/modules/locale/locale.fetch.inc +++ b/core/modules/locale/locale.fetch.inc @@ -37,9 +37,9 @@ function locale_translation_batch_update_build($projects = array(), $langcodes = $batch = array( 'operations' => $operations, - 'title' => $t('Updating translation.'), - 'init_message' => $t('Downloading and importing files.'), - 'error_message' => $t('Error importing interface translations'), + 'title' => $t('Updating translations'), + 'init_message' => $t('Downloading and importing translation files.'), + 'error_message' => $t('Error importing translation files'), 'finished' => 'locale_translation_batch_fetch_finished', 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', ); @@ -67,9 +67,9 @@ function locale_translation_batch_fetch_build($projects = array(), $langcodes = $t = get_t(); $batch = array( 'operations' => _locale_translation_fetch_operations($projects, $langcodes, $options), - 'title' => $t('Updating translation.'), - 'init_message' => $t('Downloading and importing files.'), - 'error_message' => $t('Error importing interface translations'), + 'title' => $t('Updating translations.'), + 'init_message' => $t('Downloading and importing translation files.'), + 'error_message' => $t('Error importing translation files'), 'finished' => 'locale_translation_batch_fetch_finished', 'file' => drupal_get_path('module', 'locale') . '/locale.batch.inc', );