Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/locale/locale.batch.inc @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
3 /** | 3 /** |
4 * @file | 4 * @file |
5 * Batch process to check the availability of remote or local po files. | 5 * Batch process to check the availability of remote or local po files. |
6 */ | 6 */ |
7 | 7 |
8 use Drupal\Core\Url; | |
8 use GuzzleHttp\Exception\RequestException; | 9 use GuzzleHttp\Exception\RequestException; |
9 use Psr\Http\Message\RequestInterface; | 10 use Psr\Http\Message\RequestInterface; |
10 use Psr\Http\Message\ResponseInterface; | 11 use Psr\Http\Message\ResponseInterface; |
11 use Psr\Http\Message\UriInterface; | 12 use Psr\Http\Message\UriInterface; |
12 | 13 |
97 */ | 98 */ |
98 function locale_translation_batch_status_finished($success, $results) { | 99 function locale_translation_batch_status_finished($success, $results) { |
99 if ($success) { | 100 if ($success) { |
100 if (isset($results['failed_files'])) { | 101 if (isset($results['failed_files'])) { |
101 if (\Drupal::moduleHandler()->moduleExists('dblog') && \Drupal::currentUser()->hasPermission('access site reports')) { | 102 if (\Drupal::moduleHandler()->moduleExists('dblog') && \Drupal::currentUser()->hasPermission('access site reports')) { |
102 $message = \Drupal::translation()->formatPlural(count($results['failed_files']), 'One translation file could not be checked. <a href=":url">See the log</a> for details.', '@count translation files could not be checked. <a href=":url">See the log</a> for details.', [':url' => \Drupal::url('dblog.overview')]); | 103 $message = \Drupal::translation()->formatPlural(count($results['failed_files']), 'One translation file could not be checked. <a href=":url">See the log</a> for details.', '@count translation files could not be checked. <a href=":url">See the log</a> for details.', [':url' => Url::fromRoute('dblog.overview')->toString()]); |
103 } | 104 } |
104 else { | 105 else { |
105 $message = \Drupal::translation()->formatPlural(count($results['failed_files']), 'One translation files could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.'); | 106 $message = \Drupal::translation()->formatPlural(count($results['failed_files']), 'One translation files could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.'); |
106 } | 107 } |
107 \Drupal::messenger()->addError($message); | 108 \Drupal::messenger()->addError($message); |