You are here

protected function WebformTranslationManager::getTranslatableProperties in Webform 6.x

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

Get translated properties from element manager.

Parameters

string $type: The element type.

Return value

array An array of translated properties prefixed with a hashes (#).

1 call to WebformTranslationManager::getTranslatableProperties()
WebformTranslationManager::removeUnTranslatablePropertiesFromElement in src/WebformTranslationManager.php
Remove untranslatable properties form an element.

File

src/WebformTranslationManager.php, line 249

Class

WebformTranslationManager
Defines a class to translate webform elements.

Namespace

Drupal\webform

Code

protected function getTranslatableProperties($type) {
  if (isset($this->translatableProperties[$type])) {
    return $this->translatableProperties[$type];
  }
  $element_plugin = $this->elementManager
    ->createInstance($type);
  $translatable_properties = $element_plugin
    ->getTranslatableProperties();
  $translatable_properties = array_combine($translatable_properties, $translatable_properties);
  $this->translatableProperties[$type] = WebformArrayHelper::addPrefix($translatable_properties);
  return $this->translatableProperties[$type];
}