diff --git a/features/language-plugin.feature b/features/language-plugin.feature index ab2e8693..ab39afc7 100644 --- a/features/language-plugin.feature +++ b/features/language-plugin.feature @@ -157,7 +157,7 @@ Feature: Manage translation files for a WordPress install When I try `wp language plugin install hello-dolly en_GB de_DE invalid_lang` Then STDERR should be: """ - Warning: Language 'invalid_lang' not available. + Warning: Language 'invalid_lang' for 'hello-dolly' not available. """ And STDOUT should contain: """ diff --git a/features/language-theme.feature b/features/language-theme.feature index c3b16618..fb28605f 100644 --- a/features/language-theme.feature +++ b/features/language-theme.feature @@ -142,7 +142,7 @@ Feature: Manage translation files for a WordPress install When I try `wp language theme install twentyten invalid_lang` Then STDERR should be: """ - Warning: Language 'invalid_lang' not available. + Warning: Language 'invalid_lang' for 'twentyten' not available. """ And STDOUT should be: """ diff --git a/src/WP_CLI/CommandWithTranslation.php b/src/WP_CLI/CommandWithTranslation.php index 1cfcdd33..ca4b2b9e 100644 --- a/src/WP_CLI/CommandWithTranslation.php +++ b/src/WP_CLI/CommandWithTranslation.php @@ -216,7 +216,7 @@ protected function download_language_pack( $download, $slug = null ) { } if ( ! $translation_to_load ) { - return new \WP_Error( 'not_found', "Language '{$download}' not available." ); + return new \WP_Error( 'not_found', $slug ? "Language '{$download}' for '{$slug}' not available." : "Language '{$download}' not available." ); } $translation = (object) $translation; @@ -235,7 +235,7 @@ protected function download_language_pack( $download, $slug = null ) { } if ( ! $result ) { - return new \WP_Error( 'not_installed', "Could not install language '{$download}'." ); + return new \WP_Error( 'not_installed', $slug ? "Could not install language '{$download}' for '{$slug}'." : "Could not install language '{$download}'." ); } return $translation->language;