You are here

public function LingotekInterfaceTranslationService::checkSourceStatus in Lingotek Translation 3.5.x

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

Checks the source is uploaded correctly.

Parameters

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

Return value

bool True if the component is uploaded successfully.

Overrides LingotekInterfaceTranslationServiceInterface::checkSourceStatus

File

src/LingotekInterfaceTranslationService.php, line 137

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

public function checkSourceStatus($component) {
  $document_id = $this
    ->getDocumentId($component);
  if ($document_id) {

    // Document has successfully imported.
    if ($this->lingotek
      ->getDocumentStatus($document_id)) {
      $this
        ->setSourceStatus($component, Lingotek::STATUS_CURRENT);
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
  return FALSE;
}