Skip to content
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

Open
wants to merge 4 commits into
base: 8.x
Choose a base branch
from
Open

Selective locale-check #3601

wants to merge 4 commits into from

Conversation

basarkar
Copy link

@basarkar basarkar commented Jul 2, 2018

Able to check and update selective projects. Will save lots of time and debugging.

@weitzman
Copy link
Member

Does this need to be ported to Drush9?

Also, use _convert_csv_to_array, and adjust option help to be less picky.

Copy link
Contributor

@MPParsley MPParsley left a 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));
  }

@@ -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.',
Copy link
Contributor

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.

Suggested change
'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.',

'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.',
Copy link
Contributor

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.

Suggested change
'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.

],
'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.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

Suggested change
'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.',

// Prepare the projects array.
$projects = drush_get_option('projects', NULL);
if (!empty($projects)) {
$projects = array_filter(explode(',', $projects));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested by Moshe

Suggested change
$projects = array_filter(explode(',', $projects));
$projects = _convert_csv_to_array($projects);

@bappa-ww
Copy link

New patch is coming soon for Drush9

@basarkar
Copy link
Author

The PR has been updated by applying the PR review comments. Also A drush 9 PR created for review #4156

@basarkar
Copy link
Author

@weitzman @Sutharsan Please review the latest.

Copy link
Contributor

@MPParsley MPParsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@bappa-ww
Copy link

@MPParsley Can you please update the label and request others to reverify?

@MPParsley
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants