You are here

public function LingotekCommands::requestTranslations in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8.2 src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  2. 4.0.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  3. 3.0.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  4. 3.1.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  5. 3.3.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  6. 3.4.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  7. 3.5.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  8. 3.6.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  9. 3.7.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()
  10. 3.8.x src/Cli/Commands/Drush9/LingotekCommands.php \Drupal\lingotek\Cli\Commands\Drush9\LingotekCommands::requestTranslations()

Request translations to Lingotek.

@option langcodes A comma delimited list of language codes. @usage drush ltk-request node 1 Request translations for node with ID 1. @usage drush ltk-request taxonomy_term 3 --langcodes=es,it Request Spanish and Italian translations for taxonomy term with ID 3.

@field-labels langcode: Language code @default-fields langcode

@command lingotek:request-translations @aliases ltk-request,lingotek-request-translations

Parameters

$entity_type_id: The entity type ID. E.g. "node"

$entity_id: The entity ID. E.g. "2"

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields Statuses of the given translations formatted as a table.

File

src/Cli/Commands/Drush9/LingotekCommands.php, line 104

Class

LingotekCommands
A Drush9 compatible commandfile with Lingotek operations.

Namespace

Drupal\lingotek\Cli\Commands\Drush9

Code

public function requestTranslations($entity_type_id, $entity_id, $options = [
  'langcodes' => 'all',
]) {
  $this->cliService
    ->setupOutput($this
    ->output());
  $this->cliService
    ->setLogger($this
    ->logger());
  $langcodes = StringUtils::csvToArray($options['langcodes']);
  $languages = $this->cliService
    ->requestTranslations($entity_type_id, $entity_id, $langcodes);
  return new RowsOfFields($languages);
}