diff --git a/core/modules/language/language.routing.yml b/core/modules/language/language.routing.yml index ba60f29..a3991df 100644 --- a/core/modules/language/language.routing.yml +++ b/core/modules/language/language.routing.yml @@ -34,9 +34,10 @@ language_delete: _entity_access: 'language_entity.delete' language_negotiation_browser: - pattern: 'admin/config/regional/language/detection/browser' + pattern: '/admin/config/regional/language/detection/browser' defaults: _form: '\Drupal\language\Form\NegotiationBrowserForm' + _title: 'Browser language detection configuration' requirements: _permission: 'administer languages' diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php index c4aab89..c7555c3 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Config\Context\ContextInterface; -use Drupal\Core\Extension\ModuleHandler; +use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\system\SystemConfigFormBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,19 +21,18 @@ class NegotiationBrowserForm extends SystemConfigFormBase { /** * The module handler. * - * @var \Drupal\Core\Extension\ModuleHandler + * @var \Drupal\Core\Extension\ModuleHandlerInterface */ protected $moduleHandler; /** * {@inheritdoc} * - * @param \Drupal\Core\Extension\ModuleHandler $module_handler + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler */ - public function __construct(ConfigFactory $config_factory, ContextInterface $context, ModuleHandler $module_handler) { - $this->configFactory = $config_factory; - $this->configFactory->enterContext($context); + public function __construct(ConfigFactory $config_factory, ContextInterface $context, ModuleHandlerInterface $module_handler) { + parent::__construct($config_factory, $context); $this->moduleHandler = $module_handler; } @@ -184,6 +183,12 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * Retrieves the browser's langcode mapping configuration array. + * + * @return array + * The browser's langcode mapping configuration array. + */ protected function language_get_browser_drupal_langcode_mappings() { $config = $this->configFactory->get('language.mappings'); if ($config->isNew()) {