You are here

protected function LingotekInterfaceTranslationService::saveMetadata in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  2. 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  3. 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  4. 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  5. 3.6.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  6. 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
  7. 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::saveMetadata()
5 calls to LingotekInterfaceTranslationService::saveMetadata()
LingotekInterfaceTranslationService::clearTargetStatuses in src/LingotekInterfaceTranslationService.php
Clear the target statuses.
LingotekInterfaceTranslationService::setDocumentId in src/LingotekInterfaceTranslationService.php
Sets the Lingotek document id for a given component.
LingotekInterfaceTranslationService::setJobId in src/LingotekInterfaceTranslationService.php
Sets the job ID of a given component.
LingotekInterfaceTranslationService::setTargetStatus in src/LingotekInterfaceTranslationService.php
Sets the translation status of a given component translation for a locale.
LingotekInterfaceTranslationService::updateEntityHash in src/LingotekInterfaceTranslationService.php
Updates the component hash.

File

src/LingotekInterfaceTranslationService.php, line 124

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

protected function saveMetadata($component, $metadata) {
  $state = \Drupal::state();
  $translations_metadata = $state
    ->get('lingotek.interface_translations_metadata');
  if (!$translations_metadata) {
    $translations_metadata = [];
  }
  $translations_metadata[$component] = $metadata;
  $state
    ->set('lingotek.interface_translations_metadata', $translations_metadata);
}