Skip to content

Conversation

@ocean90
Copy link
Contributor

@ocean90 ocean90 commented Oct 4, 2018

Fixes #61.

Example output:

➜  ~ wpd language theme install twentytwelve fo_Ba de_DE
Warning: Language 'fo_Ba' not found.
Warning: Could not create directory. "/srv/www/wordpress-develop/shared/public_html/develop-languages/"
Error: No languages installed (2 failed).

➜ ~ wpd language theme install twentytwelve fo_Ba de_DE
Warning: Language 'fo_Ba' not found.
Language 'de_DE' already installed.
Error: No languages installed (1 failed, 1 skipped).

➜ ~ wpd language theme install twentytwelve fo_Ba th
Warning: Language 'fo_Ba' not found.
Downloading translation from https://downloads.wordpress.org/translation/theme/twentytwelve/2.5/th.zip...
Unpacking the update...
Installing the latest version...
Translation updated successfully.
Language installed.
Error: Only installed 1 of 2 languages (1 failed).

➜ ~ wpd language theme install twentytwelve fo_Ba
Warning: Language 'fo_Ba' not found.
Error: No languages installed (1 failed).

➜ ~ wpd language theme install twentytwelve th
Language 'th' already installed.
Success: Installed 0 of 1 languages (1 skipped).

➜ ~ wpd language theme install twentytwelve es_MX
Downloading translation from https://downloads.wordpress.org/translation/theme/twentytwelve/2.5/es_MX.zip...
Unpacking the update...
Installing the latest version...
Translation updated successfully.
Language installed.
Success: Installed 1 of 1 languages.


if ( in_array( $language_code, $available, true ) ) {
\WP_CLI::warning( "Language '{$language_code}' already installed." );
\WP_CLI::log( "Language '{$language_code}' already installed." );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a skip or a success? Looks like media would treat it as a success.

https://github.com/wp-cli/media-command/blob/337459d/src/Media_Command.php#L590-L600

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at the success message, I think we can leave it as is.

Success: Installed 0 of 1 languages (1 skipped).

Copy link
Member

Choose a reason for hiding this comment

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

Yes, makes sense to me.

@ocean90 ocean90 changed the title [WIP] Make use of report_batch_operation_results() for install commands Make use of report_batch_operation_results() for install commands Oct 4, 2018
@grappler
Copy link

@schlessera Is there anything stopping this from being merged?

@ocean90
Copy link
Contributor Author

ocean90 commented Nov 20, 2018

We may want to consider using a table for the output here too, see #64 (comment).

@swissspidy
Copy link
Member

I think we can optimize the output in follow-up PRs.

@swissspidy swissspidy merged commit 11f989c into wp-cli:master Nov 30, 2018
@swissspidy swissspidy added this to the 2.0.2 milestone Nov 30, 2018
@ocean90 ocean90 deleted the report-batch-operation-results branch December 1, 2018 10:16
schlessera pushed a commit that referenced this pull request Jan 5, 2022
Make use of report_batch_operation_results() for install commands
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.

4 participants