From c19a25dacc163299f4694cc2e30b3b74103bf015 Mon Sep 17 00:00:00 2001 From: basarkar Date: Fri, 16 Aug 2019 13:53:02 -0400 Subject: [PATCH] Selective local check --- src/Drupal/Commands/core/LocaleCommands.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Drupal/Commands/core/LocaleCommands.php b/src/Drupal/Commands/core/LocaleCommands.php index c6c85f4174..4c9f9584b7 100644 --- a/src/Drupal/Commands/core/LocaleCommands.php +++ b/src/Drupal/Commands/core/LocaleCommands.php @@ -9,6 +9,7 @@ use Drupal\Core\State\StateInterface; use Drupal\language\Entity\ConfigurableLanguage; use Drush\Commands\DrushCommands; +use Drush\Utils\StringUtils; class LocaleCommands extends DrushCommands { @@ -66,17 +67,26 @@ public function __construct(LanguageManagerInterface $languageManager, ConfigFac * * @command locale:check * @aliases locale-check + * @option projects A comma-separated list of projects to update. If omitted, all projects will be updated. * @validate-module-enabled locale */ - public function check() + public function check($options = ['projects' => '']) { $this->getModuleHandler()->loadInclude('locale', 'inc', 'locale.compare'); + $projects = []; + if ($passed_projects = $options['projects']) { + $projects = StringUtils::csvToArray($passed_projects); + } + + // Remove duplicate projects. + $projects = array_unique($projects); + // Check translation status of all translatable project in all languages. // First we clear the cached list of projects. Although not strictly // necessary, this is helpful in case the project list is out of sync. locale_translation_flush_projects(); - locale_translation_check_projects(); + locale_translation_check_projects($projects); // Execute a batch if required. A batch is only used when remote files // are checked.