function LocaleServiceProvider::alter
Overrides ServiceProviderBase::alter
File
-
core/
modules/ locale/ src/ LocaleServiceProvider.php, line 17
Class
- LocaleServiceProvider
- Overrides the language_manager service to point to language's module one.
Namespace
Drupal\localeCode
public function alter(ContainerBuilder $container) : void {
if ($container->hasParameter('language.translate_english')) {
$config_storage = BootstrapConfigStorageFactory::get();
$config = $config_storage->read('locale.settings');
if ($config) {
$container->setParameter('language.translate_english', $config['translate_english'] ?? TRUE);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.