You are here

public function YamlFormTranslationManager::getTranslationElements in YAML Form 8

Get flattened associative array of translated element properties.

Parameters

\Drupal\yamlform\YamlFormInterface $yamlform: A form.

Return value

array A associative array of translated element properties.

Overrides YamlFormTranslationManagerInterface::getTranslationElements

File

src/YamlFormTranslationManager.php, line 117

Class

YamlFormTranslationManager
Defines a class to translate form elements.

Namespace

Drupal\yamlform

Code

public function getTranslationElements(YamlFormInterface $yamlform, $langcode) {
  $elements = $this
    ->getSourceElements($yamlform);
  $translation_elements = $this
    ->getConfigElements($yamlform, $langcode);
  if ($elements == $translation_elements) {
    return $elements;
  }
  YamlFormElementHelper::merge($elements, $translation_elements);
  return $elements;
}