You are here

function drush_lingotek_check_translations_statuses in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  2. 4.0.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  3. 3.0.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  4. 3.1.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  5. 3.2.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  6. 3.3.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  7. 3.5.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  8. 3.6.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  9. 3.7.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()
  10. 3.8.x lingotek.drush.inc \drush_lingotek_check_translations_statuses()

File

./lingotek.drush.inc, line 135
Drush 8 integration for Lingotek.

Code

function drush_lingotek_check_translations_statuses($entity_type_id, $entity_id) {
  $facade = new Drush8IoWrapper();

  /** @var \Drupal\lingotek\Cli\LingotekCliService $cliService */
  $cliService = \Drupal::service('lingotek.cli_service');
  $cliService
    ->setupOutput($facade);
  $cliService
    ->setLogger($facade);
  $langcodes = _convert_csv_to_array(drush_get_option('langcodes', 'all'));
  $statuses = $cliService
    ->checkTranslationsStatuses($entity_type_id, $entity_id, $langcodes);
  $table = [
    [
      dt('Language'),
      dt('Status'),
    ],
  ];
  foreach ($statuses as $status) {
    $table[] = [
      $status['langcode'],
      $status['status'],
    ];
  }
  drush_print_table($table);
}