diff --git a/core/core.services.yml b/core/core.services.yml index a795997..0ea69d4 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -384,7 +384,7 @@ services: - { name: event_subscriber } controller.page: class: Drupal\Core\Controller\HtmlPageController - arguments: ['@http_kernel', '@controller_resolver', '@title_resolver'] + arguments: ['@http_kernel', '@controller_resolver', '@string_translation', '@title_resolver'] controller.dialog: class: Drupal\Core\Controller\DialogController arguments: ['@http_kernel', '@title_resolver'] diff --git a/core/lib/Drupal/Core/Controller/HtmlPageController.php b/core/lib/Drupal/Core/Controller/HtmlPageController.php index 2fffa6e..53fa2e2 100644 --- a/core/lib/Drupal/Core/Controller/HtmlPageController.php +++ b/core/lib/Drupal/Core/Controller/HtmlPageController.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Controller; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\StringTranslation\TranslationInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -47,12 +48,15 @@ class HtmlPageController { * @param \Symfony\Component\HttpKernel\HttpKernelInterface $kernel * @param \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver * The controller resolver. + * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager + * The translation manager. * @param \Drupal\Core\Controller\TitleResolver $title_resolver * The title resolver. */ - public function __construct(HttpKernelInterface $kernel, ControllerResolverInterface $controller_resolver, TitleResolver $title_resolver) { + public function __construct(HttpKernelInterface $kernel, ControllerResolverInterface $controller_resolver, TranslationInterface $translation_manager, TitleResolver $title_resolver) { $this->httpKernel = $kernel; $this->controllerResolver = $controller_resolver; + $this->translationManager = $translation_manager; $this->titleResolver = $title_resolver; } diff --git a/core/modules/block/block.services.yml b/core/modules/block/block.services.yml index 6e87ce2..b6bf1f4 100644 --- a/core/modules/block/block.services.yml +++ b/core/modules/block/block.services.yml @@ -1,7 +1,7 @@ services: plugin.manager.block: class: Drupal\block\Plugin\Type\BlockManager - arguments: ['@container.namespaces', '@cache.block', '@language_manager', '@module_handler'] + arguments: ['@container.namespaces', '@cache.block', '@language_manager', '@module_handler', '@string_translation'] cache.block: class: Drupal\Core\Cache\CacheBackendInterface tags: 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 55c8680..5b793df 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -12,6 +12,7 @@ use Drupal\Core\Language\LanguageManager; use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\StringTranslation\TranslationInterface; /** * Manages discovery and instantiation of block plugins. @@ -43,12 +44,15 @@ class BlockManager extends DefaultPluginManager { * The language manager. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler to invoke the alter hook with. + * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager + * The translation manager. */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler) { + public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager, ModuleHandlerInterface $module_handler, TranslationInterface $translation_manager) { parent::__construct('Plugin/Block', $namespaces, 'Drupal\block\Annotation\Block'); $this->alterInfo($module_handler, 'block'); $this->setCacheBackend($cache_backend, $language_manager, 'block_plugins'); + $this->translationManager = $translation_manager; } /** diff --git a/core/modules/book/book.services.yml b/core/modules/book/book.services.yml index 9cb93bc..fa7c66c 100644 --- a/core/modules/book/book.services.yml +++ b/core/modules/book/book.services.yml @@ -6,7 +6,7 @@ services: - { name: breadcrumb_builder, priority: 701 } book.manager: class: Drupal\book\BookManager - arguments: ['@database', '@entity.manager', '@config.factory'] + arguments: ['@database', '@entity.manager', '@string_translation', '@config.factory'] book.export: class: Drupal\book\BookExport arguments: ['@entity.manager'] diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index ad229be..d953277 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Config\ConfigFactory; use Drupal\node\NodeInterface; @@ -52,9 +53,10 @@ class BookManager { /** * Constructs a BookManager object. */ - public function __construct(Connection $connection, EntityManagerInterface $entity_manager, ConfigFactory $config_factory) { + public function __construct(Connection $connection, EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactory $config_factory) { $this->connection = $connection; $this->entityManager = $entity_manager; + $this->translationManager = $translation; $this->configFactory = $config_factory; } diff --git a/core/modules/forum/forum.services.yml b/core/modules/forum/forum.services.yml index 6fe8ae4..8ea4dac 100644 --- a/core/modules/forum/forum.services.yml +++ b/core/modules/forum/forum.services.yml @@ -1,8 +1,7 @@ services: forum_manager: class: Drupal\forum\ForumManager - arguments: ['@config.factory', '@plugin.manager.entity', '@database', '@field.info'] - + arguments: ['@config.factory', '@plugin.manager.entity', '@database', '@field.info', '@string_translation'] forum.breadcrumb: class: Drupal\forum\ForumBreadcrumbBuilder arguments: ['@entity.manager', '@config.factory', '@forum_manager'] diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index 1aa64d3..02bfd05 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -11,6 +11,7 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\field\FieldInfo; use Drupal\node\NodeInterface; @@ -115,12 +116,15 @@ class ForumManager implements ForumManagerInterface { * The current database connection. * @param \Drupal\field\FieldInfo $field_info * The field info service. + * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager + * The translation manager service. */ - public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info) { + public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager) { $this->configFactory = $config_factory; $this->entityManager = $entity_manager; $this->connection = $connection; $this->fieldInfo = $field_info; + $this->translationManager = $translation_manager; } /**