wp-cli / language-command

Installs, activates, and manages language packs.
MIT License
13 stars 21 forks source link

Make use of report_batch_operation_results() for install commands #63

Closed ocean90 closed 5 years ago

ocean90 commented 5 years ago

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.
grappler commented 5 years ago

@schlessera Is there anything stopping this from being merged?

ocean90 commented 5 years ago

We may want to consider using a table for the output here too, see https://github.com/wp-cli/language-command/pull/64#issuecomment-440192901.

swissspidy commented 5 years ago

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