Ejemplo n.º 1
0
 /**
  * Gets the comment-specific parameters for use in a createContentDocumentWithTargets API call.
  *
  * @param LingotekComment
  *   The comment entity to be translated.
  *
  * @return array
  *   An array of API parameter values.
  */
 protected function getCommentCreateWithTargetsParams(LingotekComment $comment)
 {
     $target_locales = Lingotek::availableLanguageTargets("lingotek_locale");
     $parameters = array('projectId' => variable_get('lingotek_project', NULL), 'documentName' => 'comment - ' . $comment->cid, 'documentDesc' => 'comment ' . $comment->cid . ' on node ' . $comment->nid, 'format' => $this->xmlFormat(), 'applyWorkflow' => 'true', 'workflowId' => variable_get('lingotek_translate_comments_workflow_id', NULL), 'sourceLanguage' => Lingotek::convertDrupal2Lingotek($comment->language), 'tmVaultId' => variable_get('lingotek_vault', 1), 'content' => $comment->documentLingotekXML(), 'targetAsJSON' => drupal_json_encode(array_values($target_locales)), 'note' => url('node/' . $comment->nid, array('absolute' => TRUE, 'alias' => TRUE)));
     $this->addAdvancedParameters($parameters, $comment);
     return $parameters;
 }