Converts a translated data structure.
array $data: The translated data structure.
array Returns a translation array as expected by \Drupal\config_translation\FormElement\ElementInterface::setConfig().
Overrides ConfigProcessorInterface::convertToTranslation
public function convertToTranslation($data) {
$children = Element::children($data);
if ($children) {
$translation = [];
foreach ($children as $name) {
$property_data = $data[$name];
$translation[$name] = $this
->convertToTranslation($property_data);
}
return $translation;
}
elseif (isset($data['#translation']['#text'])) {
return $data['#translation']['#text'];
}
}