You are here

function drush_drush_language_language_import_translations in Drush Language Commands 8

Imports .po file(s).

File

./drush_language.drush.inc, line 125
Drush (< 9) integration for the drush_language module.

Code

function drush_drush_language_language_import_translations() {

  // Get arguments and options.
  $file_paths = func_get_args();
  $options = [
    'langcode' => drush_get_option('langcode', NULL),
    'replace-customized' => drush_get_option('set-customized', TRUE),
    'replace-not-customized' => drush_get_option('replace-customized', TRUE),
    'set-customized' => drush_get_option('replace-not-customized', TRUE),
    'autocreate-language' => drush_get_option('autocreate-language', TRUE),
  ];
  \Drupal::service('drush_language.cli')
    ->importTranslations(new Drush8Io(), 'dt', $file_paths, $options);
}