/**
  * @param bool $source_language
  * @param      $target_languages
  *
  * @internal param bool $name
  * @return bool|TranslationProxy_Batch
  */
 public function create_batch_job($source_language, $target_languages)
 {
     $batch_name = TranslationProxy_Basket::get_basket_name();
     $extra_fields = TranslationProxy_Basket::get_basket_extra_fields();
     if (!$source_language) {
         $source_language = TranslationProxy_Basket::get_source_language();
     }
     if (!$target_languages) {
         $target_languages = TranslationProxy_Basket::get_remote_target_languages();
     }
     if (!$source_language || !$target_languages) {
         return false;
     }
     if (!$batch_name) {
         $batch_name = sprintf(__('%s: WPML Translation Jobs', 'wpml-translation-management'), get_option('blogname'));
     }
     TranslationProxy_Basket::set_basket_name($batch_name);
     $params = array("api_version" => TranslationProxy_Api::API_VERSION, "project_id" => $this->id, "accesskey" => $this->access_key, 'batch' => array('source_language' => $source_language, 'target_languages' => $target_languages, 'name' => $batch_name));
     if ($extra_fields) {
         $params['extra_fields'] = $extra_fields;
     }
     try {
         $response = TranslationProxy_Api::proxy_request('/projects/{project_id}/batches.json', $params, 'POST', false);
         $batch = false;
         if ($response) {
             $batch = $response->batch;
             TranslationProxy_Basket::set_batch_data($batch);
         }
         return $batch;
     } catch (Exception $ex) {
         $this->add_error($ex->getMessage());
         return false;
     }
 }