LocaleConfigManager::getTranslatableDefaultConfig

public LocaleConfigManager::getTranslatableDefaultConfig($name)

Gets array of translated strings for Locale translatable configuration.

Parameters

string $name: Configuration object name.

Return value

array Array of Locale translatable elements of the default configuration in $name.

File

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

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

public function getTranslatableDefaultConfig($name) {
  if ($this->isSupported($name)) {
    // Create typed configuration wrapper based on install storage data.
    $data = $this->defaultConfigStorage->read($name);
    $type_definition = $this->typedConfigManager->getDefinition($name);
    $data_definition = $this->typedConfigManager->buildDataDefinition($type_definition, $data);
    $typed_config = $this->typedConfigManager->create($data_definition, $data);
    if ($typed_config instanceof TraversableTypedDataInterface) {
      return $this->getTranslatableData($typed_config);
    }
  }
  return array();
}
doc_Drupal
2016-10-29 09:23:54
Comments
Leave a Comment

Please login to continue.