public ConfigNamesMapper::getLangcodeFromConfig($config_name)
Returns the language code of a configuration object given its name.
Parameters
string $config_name: The name of the configuration object.
Return value
string The language code of the configuration object.
Overrides ConfigMapperInterface::getLangcodeFromConfig
File
- core/modules/config_translation/src/ConfigNamesMapper.php, line 396
Class
- ConfigNamesMapper
- Configuration mapper base implementation.
Namespace
Drupal\config_translation
Code
public function getLangcodeFromConfig($config_name) {
// Default to English if no language code was provided in the file.
// Although it is a best practice to include a language code, if the
// developer did not think about a multilingual use case, we fall back
// on assuming the file is English.
return $this->configFactory->get($config_name)->get('langcode') ? : 'en';
}
Please login to continue.