-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selective locale-check #3601
base: 8.x
Are you sure you want to change the base?
Selective locale-check #3601
Conversation
Does this need to be ported to Drush9? Also, use _convert_csv_to_array, and adjust option help to be less picky. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
// Prepare the projects array.
$projects = drush_get_option('projects', []);
if (!empty($projects)) {
$projects = array_filter(explode(',', $projects));
}
commands/core/locale.d8.drush.inc
Outdated
@@ -24,6 +24,13 @@ function locale_drush_command() { | |||
$items['locale-check'] = [ | |||
'description' => 'Checks for available translation updates.', | |||
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, | |||
'options' => [ | |||
'projects' => 'A comma separated and no space list of interface translation projects language to update. If omitted, all the installed projects will be updated.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make the user think, fix this in code by proper treatment of the input.
'projects' => 'A comma separated and no space list of interface translation projects language to update. If omitted, all the installed projects will be updated.', | |
'projects' => 'A comma delimited list of projects to update. If omitted, all projects will be updated.', |
commands/core/locale.d8.drush.inc
Outdated
'projects' => 'A comma separated and no space list of interface translation projects language to update. If omitted, all the installed projects will be updated.', | ||
], | ||
'examples' => [ | ||
'drush locale-check' => 'Language update for all installed interface translation projects.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command does not update, it only checks.
'drush locale-check' => 'Language update for all installed interface translation projects.', | |
'drush locale-check' => 'Checks all projects.', |
I removed the word "installed" as this is not relevant. Not installed projects are never checked.
I removed "interface translation" as this is the context of the command, and I don't see the need to repeat that here.
commands/core/locale.d8.drush.inc
Outdated
], | ||
'examples' => [ | ||
'drush locale-check' => 'Language update for all installed interface translation projects.', | ||
'drush locale-check --projects=custom_module,paragraphs' => 'Language update for custom_module and paragraphs.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
'drush locale-check --projects=custom_module,paragraphs' => 'Language update for custom_module and paragraphs.', | |
'drush locale-check --projects=custom_module,paragraphs' => 'Checks the custom_module and paragraphs projects.', |
commands/core/locale.d8.drush.inc
Outdated
// Prepare the projects array. | ||
$projects = drush_get_option('projects', NULL); | ||
if (!empty($projects)) { | ||
$projects = array_filter(explode(',', $projects)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested by Moshe
$projects = array_filter(explode(',', $projects)); | |
$projects = _convert_csv_to_array($projects); |
New patch is coming soon for Drush9 |
The PR has been updated by applying the PR review comments. Also A drush 9 PR created for review #4156 |
@weitzman @Sutharsan Please review the latest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@MPParsley Can you please update the label and request others to reverify? |
I'd love to but I'm not a maintainer on this project. |
Able to check and update selective projects. Will save lots of time and debugging.