Skip to content

Commit 41a4ecd

Browse files
committed
Add translator comments
1 parent a8af26d commit 41a4ecd

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

inc/endpoints/class-token.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function exchange_token( WP_REST_Request $request ) {
5858
if ( empty( $client ) ) {
5959
return new WP_Error(
6060
'oauth2.endpoints.token.exchange_token.invalid_client',
61+
/* translators: %s: client ID */
6162
sprintf( __( 'Client ID %s is invalid.', 'oauth2' ), $request['client_id'] ),
6263
[
6364
'status' => WP_Http::BAD_REQUEST,

inc/types/class-base.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function handle_authorisation() {
2929
if ( empty( $_GET['client_id'] ) ) {
3030
return new WP_Error(
3131
'oauth2.types.authorization_code.handle_authorisation.missing_client_id',
32+
/* translators: %s: parameter name */
3233
sprintf( __( 'Missing %s parameter.', 'oauth2' ), 'client_id' )
3334
);
3435
}
@@ -43,6 +44,7 @@ public function handle_authorisation() {
4344
if ( empty( $client ) ) {
4445
return new WP_Error(
4546
'oauth2.types.authorization_code.handle_authorisation.invalid_client_id',
47+
/* translators: %s: client ID */
4648
sprintf( __( 'Client ID %s is invalid.', 'oauth2' ), $client_id ),
4749
[
4850
'status' => WP_Http::BAD_REQUEST,
@@ -82,7 +84,7 @@ public function handle_authorisation() {
8284
$error = new WP_Error(
8385
'oauth2.types.authorization_code.handle_authorisation.invalid_submit',
8486
sprintf(
85-
/** translators: %1$s is the translated "Authorize" button, %2$s is the translated "Cancel" button */
87+
/* translators: %1$s is the translated "Authorize" button, %2$s is the translated "Cancel" button */
8688
__( 'Select either %1$s or %2$s to continue.', 'oauth2' ),
8789
__( 'Authorize', 'oauth2' ),
8890
__( 'Cancel', 'oauth2' )

theme/oauth2-authorize.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@
6363

6464
<?php echo get_avatar( $current_user->ID, '78' ); ?>
6565

66-
<p><?php
67-
printf(
68-
__( 'Howdy <strong>%1$s</strong>,<br/> "%2$s" would like to connect to %3$s.', 'oauth2' ),
69-
$current_user->user_login,
70-
$client->get_name(),
71-
get_bloginfo( 'name' )
72-
)
73-
?></p>
66+
<?php
67+
printf(
68+
/* translators: %1$s: user login, %2$s: client name, %3$s: site name */
69+
'<p>' . __( 'Howdy <strong>%1$s</strong>,<br/> "%2$s" would like to connect to %3$s.', 'oauth2' ) . '</p>',
70+
$current_user->user_login,
71+
$client->get_name(),
72+
get_bloginfo( 'name' )
73+
);
74+
?>
7475

7576
</div>
7677

0 commit comments

Comments
 (0)