You are here

protected function LanguageServiceProvider::getDefaultLanguageValues in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/LanguageServiceProvider.php \Drupal\language\LanguageServiceProvider::getDefaultLanguageValues()

Gets the default language values.

Return value

array|bool Returns the default language values for the language configured in system.site:default_langcode if the corresponding configuration entity exists, otherwise FALSE.

1 call to LanguageServiceProvider::getDefaultLanguageValues()
LanguageServiceProvider::alter in core/modules/language/src/LanguageServiceProvider.php
Modifies existing service definitions.

File

core/modules/language/src/LanguageServiceProvider.php, line 99
Contains \Drupal\language\LanguageServiceProvider.

Class

LanguageServiceProvider
Overrides the language_manager service to point to language's module one.

Namespace

Drupal\language

Code

protected function getDefaultLanguageValues() {
  $config_storage = BootstrapConfigStorageFactory::get();
  $system = $config_storage
    ->read('system.site');
  $default_language = $config_storage
    ->read(static::CONFIG_PREFIX . $system['default_langcode']);
  if (is_array($default_language)) {
    return $default_language;
  }
  return FALSE;
}