You are here

public function ContextUploader::isReadyAcceptContext in TMGMT Translator Smartling 8.2

Same name and namespace in other branches
  1. 8.4 src/Context/ContextUploader.php \Drupal\tmgmt_smartling\Context\ContextUploader::isReadyAcceptContext()
  2. 8 src/Context/ContextUploader.php \Drupal\tmgmt_smartling\Context\ContextUploader::isReadyAcceptContext()
  3. 8.3 src/Context/ContextUploader.php \Drupal\tmgmt_smartling\Context\ContextUploader::isReadyAcceptContext()

Parameters

$filename:

Return value

bool

File

src/Context/ContextUploader.php, line 282

Class

ContextUploader

Namespace

Drupal\tmgmt_smartling\Context

Code

public function isReadyAcceptContext($filename, $proj_settings) {
  try {
    $api = $this
      ->getApi($proj_settings);
    $res = $api
      ->getStatusAllLocales($filename);
    if (!$res) {
      $this->logger
        ->warning('File "@filename" is not ready to accept context. Most likely it is being processed by Smartling right now.', [
        '@filename' => $filename,
      ]);
    }
    return $res;
  } catch (Exception $e) {
    $this->logger
      ->warning($e
      ->getMessage());
    return FALSE;
  }
}