|
@@ 250-261 (lines=12) @@
|
| 247 |
|
$error = ''; |
| 248 |
|
|
| 249 |
|
$activated_count = count( $activated ); |
| 250 |
|
if ( $activated_count > 0 ) { |
| 251 |
|
$activated_last = array_pop( $activated ); |
| 252 |
|
$activated_text = $activated_count > 1 ? sprintf( |
| 253 |
|
/* Translators: first variable is a list followed by the last item, which is the second variable. Example: dog, cat and bird. */ |
| 254 |
|
__( '%1$s and %2$s', 'jetpack' ), |
| 255 |
|
join( ', ', $activated ), $activated_last ) : $activated_last; |
| 256 |
|
|
| 257 |
|
$error = sprintf( |
| 258 |
|
/* Translators: the variable is a module name. */ |
| 259 |
|
_n( 'The module %s was activated.', 'The modules %s were activated.', $activated_count, 'jetpack' ), |
| 260 |
|
$activated_text ) . ' '; |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
$failed_count = count( $failed ); |
| 264 |
|
if ( count( $failed ) > 0 ) { |
|
@@ 264-275 (lines=12) @@
|
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
$failed_count = count( $failed ); |
| 264 |
|
if ( count( $failed ) > 0 ) { |
| 265 |
|
$failed_last = array_pop( $failed ); |
| 266 |
|
$failed_text = $failed_count > 1 ? sprintf( |
| 267 |
|
/* Translators: first variable is a list followed by the last item, which is the second variable. Example: dog, cat and bird. */ |
| 268 |
|
__( '%1$s and %2$s', 'jetpack' ), |
| 269 |
|
join( ', ', $failed ), $failed_last ) : $failed_last; |
| 270 |
|
|
| 271 |
|
$error = sprintf( |
| 272 |
|
/* Translators: the variable is a module name. */ |
| 273 |
|
_n( 'The module %s failed to be activated.', 'The modules %s failed to be activated.', $failed_count, 'jetpack' ), |
| 274 |
|
$failed_text ) . ' '; |
| 275 |
|
} |
| 276 |
|
|
| 277 |
|
return new WP_Error( |
| 278 |
|
'activation_failed', |