Skip to content

Commit 1fc169f

Browse files
authored
Merge pull request #326 from lloc/refactoring-version-2-8
Plugin Check review
2 parents a31aefb + f2bb69b commit 1fc169f

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

includes/MslsAdminIcon.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,17 @@ public function get_img(): string {
205205
*/
206206
public function get_a(): string {
207207
if ( empty( $this->href ) ) {
208-
$title = sprintf(
209-
__( 'Create a new translation in the %s-blog', 'multisite-language-switcher' ),
210-
$this->language
211-
);
212-
$href = $this->get_edit_new();
208+
$format = __( 'Create a new translation in the %s-blog', 'multisite-language-switcher' );
209+
$href = $this->get_edit_new();
213210
} else {
214-
$title = sprintf(
215-
__( 'Edit the translation in the %s-blog', 'multisite-language-switcher' ),
216-
$this->language
217-
);
218-
$href = $this->href;
211+
/* translators: %s: blog name */
212+
$format = __( 'Edit the translation in the %s-blog', 'multisite-language-switcher' );
213+
$href = $this->href;
219214
}
220215

221-
return sprintf( '<a title="%s" href="%s">%s</a>&nbsp;', $title, $href, $this->get_icon() );
216+
$title = sprintf( $format, $this->language );
217+
218+
return sprintf( '<a title="%1$s" href="%2$s">%3$s</a>&nbsp;', $title, $href, $this->get_icon() );
222219
}
223220

224221
/**

includes/MslsCustomFilter.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public function add_filter(): void {
5151
if ( $blogs ) {
5252
$options = array( '' => esc_html( __( 'Show all posts', 'multisite-language-switcher' ) ) );
5353
foreach ( $blogs as $blog ) {
54-
$options[ strval( $blog->userblog_id ) ] = sprintf(
55-
__( 'Not translated in the %s-blog', 'multisite-language-switcher' ),
56-
$blog->get_description()
57-
);
54+
/* translators: %s: blog name */
55+
$format = __( 'Not translated in the %s-blog', 'multisite-language-switcher' );
56+
57+
$options[ strval( $blog->userblog_id ) ] = sprintf( $format, $blog->get_description() );
5858
}
5959

6060
$id = MslsRequest::get( MslsFields::FIELD_MSLS_FILTER, 0 );

0 commit comments

Comments
 (0)