You are here

function potx_drush_command in Translation template extractor 8

Same name and namespace in other branches
  1. 6.3 potx.drush.inc \potx_drush_command()
  2. 7.3 potx.drush.inc \potx_drush_command()
  3. 7.2 potx.drush.inc \potx_drush_command()

Implements hook_drush_command().

See also

drush_parse_command()

File

./potx.drush.inc, line 13
Translation template extractor module drush integration.

Code

function potx_drush_command() {
  $items['potx'] = [
    'callback' => 'potx_drush_extract',
    'description' => 'Extract translatable strings from Drupal source code.',
    'arguments' => [
      'mode' => 'potx output mode e.g. single multiple core',
    ],
    'options' => [
      'modules' => 'Comma delimited list of modules to extract translatable strings from.',
      'files' => 'Comma delimited list of files to extract translatable strings from.',
      'folder' => 'Folder to begin translation extraction in. When no other option is set this defaults to current directory.',
      'api' => 'Drupal core version to use for extraction settings.',
      'language' => 'Language code if the template should have language dependent content (like plural formulas and language name) included.',
      'translations' => 'Enable translations export.',
    ],
    'examples' => [
      'potx single' => 'Extract translatable strings from applicable files in current directory and write to single output file',
      'potx multiple --modules=example' => 'Extract translatable strings from applicable files of example module and write to module-specific output file.',
      'potx --files=sites/all/modules/example/example.module' => 'Extract translatable strings from example.module and write to single output file.',
      'potx single --api=8 --folder=projects/drupal/8' => 'Extract strings from folder projects/drupal/8 using API version 8.',
    ],
    'bootstrap' => DRUSH_BOOTSTRAP_NONE,
  ];
  return $items;
}