You are here

public function LocaleConfigManager::getActiveConfigLangcode in Drupal 8

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

Returns the current language code for this active configuration.

Parameters

string $name: The configuration name.

Return value

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

1 call to LocaleConfigManager::getActiveConfigLangcode()
LocaleConfigManager::updateConfigTranslations in core/modules/locale/src/LocaleConfigManager.php
Updates all configuration translations for the names / languages provided.

File

core/modules/locale/src/LocaleConfigManager.php, line 514

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

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