diff --git a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php index f3686d0..9c30cfb 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -89,14 +89,23 @@ public function processDefinition(&$definition, $plugin_id) { protected function getModuleName($module) { // Gather module data. if (!isset($this->moduleData)) { - $this->moduleData = system_rebuild_module_data(); + $this->moduleData = system_get_info('module'); } // If the module exists, return its human-readable name. if (isset($this->moduleData[$module])) { - return $this->translationManager->translate($this->moduleData[$module]->info['name']); + return $this->t($this->moduleData[$module]['name']); } // Otherwise, return the machine name. return $module; } + /** + * Translates a string to the current language or to a given language. + * + * See the t() documentation for details. + */ + protected function t($string, array $args = array(), array $options = array()) { + return $this->translationManager->translate($string, $args, $options); + } + }