From 36bdae9b677a533a785c14cded2aa0b61a695954 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Mon, 19 Feb 2024 12:56:41 +0545 Subject: [PATCH 1/2] Update warning message in language command --- src/WP_CLI/CommandWithTranslation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From a249271de65bb8a1d894a09f7774d4c53a022914 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Mon, 19 Feb 2024 13:24:04 +0545 Subject: [PATCH 2/2] Update behat test to acommodate message change --- features/language-plugin.feature | 2 +- features/language-theme.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: """