W3cubDocs

/Drupal 8

public function UnmetDependenciesException::getTranslatedMessage

public UnmetDependenciesException::getTranslatedMessage(TranslationInterface $string_translation, $extension)

Gets a translated message from the exception.

Parameters

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

Return value

string

File

core/lib/Drupal/Core/Config/UnmetDependenciesException.php, line 55

Class

UnmetDependenciesException
An exception thrown if configuration has unmet dependencies.

Namespace

Drupal\Core\Config

Code

public function getTranslatedMessage(TranslationInterface $string_translation, $extension) {
  return $string_translation->formatPlural(
  count($this->getConfigObjects()), 
  'Unable to install @extension, %config_names has unmet dependencies.', 
  'Unable to install @extension, %config_names have unmet dependencies.', 
  [
    '%config_names' => implode(', ', $this->getConfigObjects()),
    '@extension' => $extension,
  ]
  );
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!UnmetDependenciesException.php/function/UnmetDependenciesException::getTranslatedMessage/8.1.x