function LocaleConfigManager::getActiveConfigLangcode
Same name in other branches
- 9 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getActiveConfigLangcode()
- 10 core/modules/locale/src/LocaleConfigManager.php \Drupal\locale\LocaleConfigManager::getActiveConfigLangcode()
- 11.x 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\localeCode
public function getActiveConfigLangcode($name) {
$active = $this->configStorage
->read($name);
if (!empty($active)) {
return !empty($active['langcode']) ? $active['langcode'] : 'en';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.