You are here

public function LocaleConfigManager::getDefaultConfigLangcode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getDefaultConfigLangcode()

Returns the original language code for this shipped configuration.

Parameters

string $name: The configuration name.

Return value

null|string Language code of the default configuration for $name. If the default configuration data for $name did not contain a language code, it is assumed to be English. The return value is NULL if no such default configuration exists.

1 call to LocaleConfigManager::getDefaultConfigLangcode()
LocaleConfigManager::isSupported in core/modules/locale/src/LocaleConfigManager.php
Whether the given configuration is supported for interface translation.

File

core/modules/locale/src/LocaleConfigManager.php, line 479
Contains \Drupal\locale\LocaleConfigManager.

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

public function getDefaultConfigLangcode($name) {
  $shipped = $this->defaultConfigStorage
    ->read($name);
  if (!empty($shipped)) {
    return !empty($shipped['langcode']) ? $shipped['langcode'] : 'en';
  }
}