diff -u b/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php --- b/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -505,7 +505,7 @@ } } catch (\Exception $e) { - $this->logError($this->translationManager->translate('Unexpected error during import with operation @op for @name: @message', array('@op' => $op, '@name' => $name, '@message' => $e->getMessage()))); + $this->logError($this->t('Unexpected error during import with operation @op for @name: @message', array('@op' => $op, '@name' => $name, '@message' => $e->getMessage()))); // Error for that operation was logged, mark it as processed so that // the import can continue. $this->setProcessedConfiguration($op, $name); @@ -600,7 +600,7 @@ } else { $this->storageComparer->getTargetStorage()->delete($name); - $this->logError($this->translationManager->translate('Deleted and replaced configuration "@name"', array('@name' => $name))); + $this->logError($this->t('Deleted and replaced configuration "@name"', array('@name' => $name))); } return TRUE; } @@ -608,7 +608,7 @@ case 'update': if (!$target_exists) { - $this->logError($this->translationManager->translate('Update target "@name" is missing.', array('@name' => $name))); + $this->logError($this->t('Update target "@name" is missing.', array('@name' => $name))); // Mark as processed so that the synchronisation continues. Once the // the current synchronisation is complete it will show up as a // create. @@ -774,2 +774,27 @@ } + + /** + * Translates a string to the current language or to a given language. + * + * @param string $string + * A string containing the English string to translate. + * @param array $args + * An associative array of replacements to make after translation. Based + * on the first character of the key, the value is escaped and/or themed. + * See \Drupal\Component\Utility\String::format() for details. + * @param array $options + * An associative array of additional options, with the following elements: + * - 'langcode': The language code to translate to a language other than + * what is used to display the page. + * - 'context': The context the source string belongs to. + * + * @return string + * The translated string. + * + * @see \Drupal\Core\StringTranslation\TranslationManager::translate() + */ + protected function t($string, array $args = array(), array $options = array()) { + return $this->translationManager->translate($string, $args, $options); + } + }