Skip to content

Commit bad3e76

Browse files
Add some strings to be translatable
1 parent 9a98868 commit bad3e76

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

includes/SSO_CLI.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public function __invoke( $args, $assoc_args ) {
7171
if ( isset( $assoc_args['url-only'] ) ) {
7272
\WP_CLI::log( $link );
7373
} else {
74-
$this->success( 'Single-use login link valid for ' . $this->expiry_min . ' minutes' );
74+
/* Translators: %d number */
75+
$this->success( sprintf( __( 'Single-use login link valid for %d minutes', 'wp-module-sso' ), $this->expiry_min ) );
7576
$this->colorize_log( $link, 'underline' );
7677
}
77-
7878
}
7979

8080
/**
@@ -142,7 +142,7 @@ protected function create_salt_nonce_and_hash() {
142142
}
143143

144144

145-
/**
145+
/**
146146
* Helper to format data into tables.
147147
*
148148
* By default, the method creates simple $key => $value tables.
@@ -193,7 +193,7 @@ protected function bold_heading( $message, $emoji = '' ) {
193193
* @param string $message
194194
*/
195195
protected function success( $message, $silent = false ) {
196-
$pre_ = $silent ? '' : 'Success: ';
196+
$pre_ = $silent ? '' : __( 'Success: ', 'wp-module-sso' );
197197
$this->colorize_log( $pre_ . $message, '2', 'k', '' );
198198
}
199199

@@ -226,7 +226,7 @@ protected function warning( $message ) {
226226
* @throws \WP_CLI\ExitException
227227
*/
228228
protected function error( $message, $silent = false, $halt = true, $code = 400 ) {
229-
$pre_ = $silent ? '' : 'Error: ';
229+
$pre_ = $silent ? '' : __( 'Error: ', 'wp-module-sso' );
230230
$this->colorize_log( $pre_ . $message, '1', 'W', '🛑️' );
231231
if ( $halt ) {
232232
WP_CLI::halt( $code );
@@ -275,7 +275,7 @@ protected function log_to_json( $data ) {
275275
} elseif ( is_array( json_decode( $data, true ) ) ) {
276276
\WP_CLI::log( $data );
277277
} else {
278-
$this->error( 'Provided $data wasn\'t valid array or JSON string.' );
278+
$this->error( __( 'Provided $data wasn\'t valid array or JSON string.', 'wp-module-sso' ) );
279279
}
280280
}
281281

0 commit comments

Comments
 (0)