You are here

public function LingotekConfigTranslationService::saveConfigTargetData in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  2. 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  3. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  4. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  5. 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  6. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  7. 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  8. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  9. 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  10. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
  11. 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::saveConfigTargetData()
2 calls to LingotekConfigTranslationService::saveConfigTargetData()
LingotekConfigTranslationService::downloadConfig in src/LingotekConfigTranslationService.php
Downloads a document to the Lingotek service.
LingotekConfigTranslationService::saveTargetData in src/LingotekConfigTranslationService.php

File

src/LingotekConfigTranslationService.php, line 1564

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function saveConfigTargetData(ConfigNamesMapper $mapper, $langcode, $data) {
  $names = $mapper
    ->getConfigNames();
  if (!empty($names)) {
    foreach ($names as $name) {
      $config_translation = $this->languageManager
        ->getLanguageConfigOverride($langcode, $name);
      foreach ($data as $name => $properties) {
        foreach ($properties as $property => $value) {
          $config_translation
            ->set($property, html_entity_decode($value));
        }
        $config_translation
          ->save();
      }
    }
  }
}