Skip to content

Commit 5bd3067

Browse files
authored
Merge pull request #139 from ernilambar/138-plugin-language
2 parents 4d0a2e5 + a249271 commit 5bd3067

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

features/language-plugin.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Feature: Manage translation files for a WordPress install
157157
When I try `wp language plugin install hello-dolly en_GB de_DE invalid_lang`
158158
Then STDERR should be:
159159
"""
160-
Warning: Language 'invalid_lang' not available.
160+
Warning: Language 'invalid_lang' for 'hello-dolly' not available.
161161
"""
162162
And STDOUT should contain:
163163
"""

features/language-theme.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Feature: Manage translation files for a WordPress install
142142
When I try `wp language theme install twentyten invalid_lang`
143143
Then STDERR should be:
144144
"""
145-
Warning: Language 'invalid_lang' not available.
145+
Warning: Language 'invalid_lang' for 'twentyten' not available.
146146
"""
147147
And STDOUT should be:
148148
"""

src/WP_CLI/CommandWithTranslation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ protected function download_language_pack( $download, $slug = null ) {
216216
}
217217

218218
if ( ! $translation_to_load ) {
219-
return new \WP_Error( 'not_found', "Language '{$download}' not available." );
219+
return new \WP_Error( 'not_found', $slug ? "Language '{$download}' for '{$slug}' not available." : "Language '{$download}' not available." );
220220
}
221221
$translation = (object) $translation;
222222

@@ -235,7 +235,7 @@ protected function download_language_pack( $download, $slug = null ) {
235235
}
236236

237237
if ( ! $result ) {
238-
return new \WP_Error( 'not_installed', "Could not install language '{$download}'." );
238+
return new \WP_Error( 'not_installed', $slug ? "Could not install language '{$download}' for '{$slug}'." : "Could not install language '{$download}'." );
239239
}
240240

241241
return $translation->language;

0 commit comments

Comments
 (0)