You are here

public function WebformTranslationManager::getTranslationElements in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformTranslationManager.php \Drupal\webform\WebformTranslationManager::getTranslationElements()

Get flattened associative array of translated element properties.

Parameters

\Drupal\webform\WebformInterface $webform: A webform.

string $langcode: The language code for the translated element properties.

Return value

array A associative array of translated element properties.

Overrides WebformTranslationManagerInterface::getTranslationElements

File

src/WebformTranslationManager.php, line 178

Class

WebformTranslationManager
Defines a class to translate webform elements.

Namespace

Drupal\webform

Code

public function getTranslationElements(WebformInterface $webform, $langcode) {
  $elements = $this
    ->getSourceElements($webform);
  $translation_elements = $this
    ->getElements($webform, $langcode);
  if ($elements === $translation_elements) {
    return $elements;
  }
  WebformElementHelper::merge($elements, $translation_elements);
  return $elements;
}