Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/msls-quick-create.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions includes/Admin/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,19 @@ protected function get_quick_create_a(): string {
$target_blog_id = get_current_blog_id();

/* translators: %s: blog name */
$format = __( 'Create a new translation in the %s-blog', 'multisite-language-switcher' );
$title = sprintf( $format, $this->language );
$title = sprintf( __( 'Create a new translation in the %s-blog', 'multisite-language-switcher' ), $this->language );

/* translators: %s: blog name */
$edit_title = sprintf( __( 'Edit the translation in the %s-blog', 'multisite-language-switcher' ), $this->language );

return sprintf(
'<button type="button" class="msls-quick-create" title="%1$s" aria-label="%1$s" data-target-blog-id="%2$d" data-source-post-id="%3$d" data-source-blog-id="%4$d">%5$s</button>&nbsp;',
'<button type="button" class="msls-quick-create" title="%1$s" aria-label="%1$s" data-target-blog-id="%2$d" data-source-post-id="%3$d" data-source-blog-id="%4$d" data-edit-title="%6$s">%5$s</button>&nbsp;',
esc_attr( $title ),
$target_blog_id,
$this->id,
$source_blog_id,
$this->get_icon()
$this->get_icon(),
esc_attr( $edit_title )
);
}

Expand Down
17 changes: 15 additions & 2 deletions includes/Cli/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,22 @@ public function blog( $args ): void {
$blog = msls_blog( $locale );

if ( is_null( $blog ) ) {
\WP_CLI::error( sprintf( 'No blog with locale %1$s found!', esc_attr( $locale ) ) );
\WP_CLI::error(
sprintf(
/* translators: %s: locale code, e.g. de_DE. */
esc_html__( 'No blog with locale %1$s found!', 'multisite-language-switcher' ),
esc_attr( $locale )
)
);
} else {
\WP_CLI::success( sprintf( 'Blog ID %1$d has locale %2$s!', $blog->userblog_id, esc_attr( $locale ) ) );
\WP_CLI::success(
sprintf(
/* translators: 1: blog ID, 2: locale code, e.g. de_DE. */
esc_html__( 'Blog ID %1$d has locale %2$s!', 'multisite-language-switcher' ),
$blog->userblog_id,
esc_attr( $locale )
)
);
}
}
}
1 change: 1 addition & 0 deletions includes/Component/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ abstract class Component {
'data-target-blog-id' => true,
'data-source-post-id' => true,
'data-source-blog-id' => true,
'data-edit-title' => true,
),
'form' => array(
'action' => true,
Expand Down
3 changes: 2 additions & 1 deletion src/msls-quick-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jQuery( document ).ready(
).then(
function ( response ) {
var isMetabox = $button.closest( '#msls' ).length > 0;
var editTitle = $button.data( 'edit-title' ) || $button.attr( 'title' );
var $link = $( '<a>' )
.attr( 'href', response.edit_url )
.attr( 'title', $button.attr( 'title' ).replace( /Create/, 'Edit' ) )
.attr( 'title', editTitle )
.html( $button.html() );

if ( isMetabox ) {
Expand Down