diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php index f705d4e..d8c0700 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php @@ -65,6 +65,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { $this->derivatives[$route_name]['class'] = '\Drupal\config_translation\Plugin\Menu\ContextualLink\ConfigTranslationContextualLink'; $this->derivatives[$route_name]['route_name'] = $route_name; $this->derivatives[$route_name]['group'] = $group_name; + $this->derivatives[$route_name]['title_arguments'] = array('@type_name' => $mapper->getTypeLabel()); } return parent::getDerivativeDefinitions($base_plugin_definition); } diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php index 53077d6..6b2fad8 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationLocalTasks.php @@ -69,6 +69,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { $this->derivatives[$route_name]['class'] = '\Drupal\config_translation\Plugin\Menu\LocalTask\ConfigTranslationLocalTask'; $this->derivatives[$route_name]['route_name'] = $route_name; $this->derivatives[$route_name]['base_route'] = $base_route; + $this->derivatives[$route_name]['title_arguments'] = array('@type_name' => $mapper->getTypeLabel()); } } return parent::getDerivativeDefinitions($base_plugin_definition); diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/ContextualLink/ConfigTranslationContextualLink.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/ContextualLink/ConfigTranslationContextualLink.php deleted file mode 100644 index 98ffb0e..0000000 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/ContextualLink/ConfigTranslationContextualLink.php +++ /dev/null @@ -1,55 +0,0 @@ -pluginDefinition['title_context'])) { - $options['context'] = $this->pluginDefinition['title_context']; - } - - // Take custom 'config_translation_plugin_id' plugin definition key to - // retrieve title. We need to retrieve a runtime title (as opposed to - // storing the title on the plugin definition for the link) because - // it contains translated parts that we need in the runtime language. - $type_name = Unicode::strtolower($this->mapperManager()->createInstance($this->pluginDefinition['config_translation_plugin_id'])->getTypeLabel()); - return $this->t($this->pluginDefinition['title'], array('@type_name' => $type_name), $options); - } - - /** - * Gets the mapper manager. - * - * @return \Drupal\config_translation\ConfigMapperManagerInterface - * The mapper manager. - */ - protected function mapperManager() { - if (!$this->mapperManager) { - $this->mapperManager = \Drupal::service('plugin.manager.config_translation.mapper'); - } - return $this->mapperManager; - } - -} diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php deleted file mode 100644 index 46a2ec2..0000000 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php +++ /dev/null @@ -1,55 +0,0 @@ -pluginDefinition['title_context'])) { - $options['context'] = $this->pluginDefinition['title_context']; - } - - // Take custom 'config_translation_plugin_id' plugin definition key to - // retrieve title. We need to retrieve a runtime title (as opposed to - // storing the title on the plugin definition for the link) because - // it contains translated parts that we need in the runtime language. - $type_name = Unicode::strtolower($this->mapperManager()->createInstance($this->pluginDefinition['config_translation_plugin_id'])->getTypeLabel()); - return $this->t($this->pluginDefinition['title'], array('@type_name' => $type_name), $options); - } - - /** - * Gets the mapper manager. - * - * @return \Drupal\config_translation\ConfigMapperManagerInterface - * The mapper manager. - */ - protected function mapperManager() { - if (!$this->mapperManager) { - $this->mapperManager = \Drupal::service('plugin.manager.config_translation.mapper'); - } - return $this->mapperManager; - } - -}