Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/language-plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/language-theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/WP_CLI/CommandWithTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down