protected function LanguageServiceProvider::isMultilingual in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/language/src/LanguageServiceProvider.php \Drupal\language\LanguageServiceProvider::isMultilingual()
Checks whether the site is multilingual.
Return value
bool TRUE if the site is multilingual, FALSE otherwise.
2 calls to LanguageServiceProvider::isMultilingual()
- LanguageServiceProvider::alter in core/
modules/ language/ src/ LanguageServiceProvider.php - Modifies existing service definitions.
- LanguageServiceProvider::register in core/
modules/ language/ src/ LanguageServiceProvider.php - Registers services to the container.
File
- core/
modules/ language/ src/ LanguageServiceProvider.php, line 77 - Contains \Drupal\language\LanguageServiceProvider.
Class
- LanguageServiceProvider
- Overrides the language_manager service to point to language's module one.
Namespace
Drupal\languageCode
protected function isMultilingual() {
// Assign the prefix to a local variable so it can be used in an anonymous
// function.
$prefix = static::CONFIG_PREFIX;
// @todo Try to swap out for config.storage to take advantage of database
// and caching. This might prove difficult as this is called before the
// container has finished building.
$config_storage = BootstrapConfigStorageFactory::get();
$config_ids = array_filter($config_storage
->listAll($prefix), function ($config_id) use ($prefix) {
return $config_id != $prefix . LanguageInterface::LANGCODE_NOT_SPECIFIED && $config_id != $prefix . LanguageInterface::LANGCODE_NOT_APPLICABLE;
});
return count($config_ids) > 1;
}