You are here

public function SmartlingApiWrapper::createTranslationRequest in TMGMT Translator Smartling 8.4

Create translation request.

Parameters

$bucketName:

\Smartling\TranslationRequests\Params\CreateTranslationRequestParams $params:

Return value

mixed

File

src/Smartling/SmartlingApiWrapper.php, line 350
SmartlingApiWrapper.php.

Class

SmartlingApiWrapper
Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function createTranslationRequest($bucketName, CreateTranslationRequestParams $params) {
  $result = FALSE;
  try {
    $result = $this
      ->getApi('translation_request')
      ->createTranslationRequest($bucketName, $params);
  } catch (SmartlingApiException $e) {
    $this->logger
      ->error('Smartling failed to create translation request:<br/>
      Bucket name: @bucket
      Params: @params
      Error: @error', [
      '@bucket' => $bucketName,
      '@params' => json_encode($params
        ->exportToArray()),
      '@error' => $e
        ->getMessage(),
    ]);
  }
  return $result;
}