You are here

protected function LingotekConfigTranslationService::getTranslatableProperties in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  2. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  3. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  4. 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  5. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  6. 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  7. 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  8. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  9. 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  10. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()
  11. 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getTranslatableProperties()

Get the translatable properties for this schema.

Parameters

$schema: The schema

$base_key: The base name for constructing the canonical name.

Return value

array Canonical names of the translatable properties.

1 call to LingotekConfigTranslationService::getTranslatableProperties()
LingotekConfigTranslationService::getConfigTranslatableProperties in src/LingotekConfigTranslationService.php
Gets the configuration translatable properties of the given mapper.

File

src/LingotekConfigTranslationService.php, line 155
Contains \Drupal\lingotek\LingotekConfigTranslationService.

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

protected function getTranslatableProperties($schema, $base_key) {
  $properties = [];
  $definition = $schema
    ->getDataDefinition();
  if (isset($definition['form_element_class'])) {
    foreach ($schema as $key => $element) {
      $element_key = isset($base_key) ? "{$base_key}.{$key}" : $key;
      $definition = $element
        ->getDataDefinition();
      if ($element instanceof TraversableTypedDataInterface) {
        $properties = array_merge($properties, $this
          ->getTranslatableProperties($element, $element_key));
      }
      else {
        if (isset($definition['form_element_class'])) {
          $properties[] = $element_key;
        }
      }
    }
  }
  return $properties;
}