You are here

public function LingotekInterfaceTranslationService::deleteMetadata in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  2. 3.2.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  3. 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  4. 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  5. 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  6. 3.6.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()
  7. 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::deleteMetadata()

Deletes all local metadata related to an component.

Parameters

string $component: The component which we want to forget about.

Return value

string The component.

Overrides LingotekInterfaceTranslationServiceInterface::deleteMetadata

9 calls to LingotekInterfaceTranslationService::deleteMetadata()
LingotekInterfaceTranslationService::addTarget in src/LingotekInterfaceTranslationService.php
Request a translation for a given component in the given locale.
LingotekInterfaceTranslationService::cancelDocument in src/LingotekInterfaceTranslationService.php
Cancels a document from the server.
LingotekInterfaceTranslationService::cancelDocumentTarget in src/LingotekInterfaceTranslationService.php
Cancels a translation for a given component in the given locale.
LingotekInterfaceTranslationService::checkSourceStatus in src/LingotekInterfaceTranslationService.php
Checks the source is uploaded correctly.
LingotekInterfaceTranslationService::downloadDocument in src/LingotekInterfaceTranslationService.php
Downloads a document from the Lingotek service for a given locale.

... See full list

File

src/LingotekInterfaceTranslationService.php, line 918

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

public function deleteMetadata($component) {
  $doc_id = $this
    ->getDocumentId($component);
  if ($doc_id) {
    $this
      ->cancelDocument($component);
  }
  $state = \Drupal::state();
  $translations_metadata = $state
    ->get('lingotek.interface_translations_metadata');
  if ($translations_metadata) {
    unset($translations_metadata[$component]);
    $state
      ->set('lingotek.interface_translations_metadata', $translations_metadata);
  }
}