ConfigTranslationLocalTask.php in Drupal 8
File
core/modules/config_translation/src/Plugin/Menu/LocalTask/ConfigTranslationLocalTask.php
View source
<?php
namespace Drupal\config_translation\Plugin\Menu\LocalTask;
use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\HttpFoundation\Request;
class ConfigTranslationLocalTask extends LocalTaskDefault {
use StringTranslationTrait;
protected $mapperManager;
public function getTitle(Request $request = NULL) {
$type_name = mb_strtolower($this
->mapperManager()
->createInstance($this->pluginDefinition['config_translation_plugin_id'])
->getTypeLabel());
return $this
->t('Translate @type_name', [
'@type_name' => $type_name,
]);
}
protected function mapperManager() {
if (!$this->mapperManager) {
$this->mapperManager = \Drupal::service('plugin.manager.config_translation.mapper');
}
return $this->mapperManager;
}
}