You are here

function drush_lingotek_download_translations in Lingotek Translation 3.4.x

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

File

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

Code

function drush_lingotek_download_translations($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'));
  return $cliService
    ->downloadTranslations($entity_type_id, $entity_id, $langcodes);
}