You are here

public function LingotekInterfaceTranslationService::setTargetStatus in Lingotek Translation 3.4.x

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

Sets the translation status of a given component translation for a locale.

Parameters

string $component: The component which status we want to change.

string $langcode: Language code which we want to modify.

int $status: Status of the translation. Use Lingotek constants.

Return value

string

Overrides LingotekInterfaceTranslationServiceInterface::setTargetStatus

11 calls to LingotekInterfaceTranslationService::setTargetStatus()
LingotekInterfaceTranslationService::addTarget in src/LingotekInterfaceTranslationService.php
Request a translation for a given component in the given locale.
LingotekInterfaceTranslationService::cancelDocumentTarget in src/LingotekInterfaceTranslationService.php
Cancels a translation for a given component in the given locale.
LingotekInterfaceTranslationService::checkTargetStatus in src/LingotekInterfaceTranslationService.php
Gets the current status of the target translation.
LingotekInterfaceTranslationService::checkTargetStatuses in src/LingotekInterfaceTranslationService.php
Gets the current status of all the target translations.
LingotekInterfaceTranslationService::clearTargetStatuses in src/LingotekInterfaceTranslationService.php
Clear the target statuses.

... See full list

File

src/LingotekInterfaceTranslationService.php, line 302

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

public function setTargetStatus($component, $langcode, $status) {
  $metadata = $this
    ->getMetadata($component);
  $metadata['translation_status'][$langcode] = $status;
  $this
    ->saveMetadata($component, $metadata);
  return $component;
}