Media: Update some attach/detach strings in the columns view.

* Show a "Media attachment reattached."/"Media attachment detached." message when only one attachment was attached/detached. 
* Use the string placeholder as `number_format_i18n()` returns a string.
* Add translator comments.
* Update help text to refer to the new dropdown menus.
* Add a more generic title to the attach modal.

Fixes #33237.

git-svn-id: https://develop.svn.wordpress.org/trunk@36328 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-01-15 22:28:15 +00:00
parent 7ee3e02d72
commit 54abada4cc
2 changed files with 22 additions and 7 deletions

View File

@ -1483,7 +1483,7 @@ function find_posts_div($found_action = '') {
?>
<div id="find-posts" class="find-box" style="display: none;">
<div id="find-posts-head" class="find-box-head">
<?php _e( 'Find Posts or Pages' ); ?>
<?php _e( 'Attach to existing content' ); ?>
<div id="find-posts-close"></div>
</div>
<div class="find-box-inside">

View File

@ -182,7 +182,7 @@ get_current_screen()->add_help_tab( array(
'title' => __('Overview'),
'content' =>
'<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>' .
'<p>' . __( 'You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.' ) . '</p>' .
'<p>' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '</p>' .
'<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>'
) );
get_current_screen()->add_help_tab( array(
@ -235,12 +235,24 @@ if ( ! empty( $_GET['posted'] ) ) {
}
if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) {
$message = sprintf( _n( 'Reattached %d attachment.', 'Reattached %d attachments.', $attached ), $attached );
if ( 1 == $attached ) {
$message = __( 'Media attachment reattached.' );
} else {
/* translators: %s: number of media attachments */
$message = _n( '%s media attachment reattached.', '%s media attachments reattached.', $attached );
}
$message = sprintf( $message, number_format_i18n( $attached ) );
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
}
if ( ! empty( $_GET['detach'] ) && $detached = absint( $_GET['detach'] ) ) {
$message = sprintf( _n( 'Detached %d attachment.', 'Detached %d attachments.', $detached ), $detached );
if ( 1 == $detached ) {
$message = __( 'Media attachment detached.' );
} else {
/* translators: %s: number of media attachments */
$message = _n( '%s media attachment detached.', '%s media attachments detached.', $detached );
}
$message = sprintf( $message, number_format_i18n( $detached ) );
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
}
@ -248,7 +260,8 @@ if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
if ( 1 == $deleted ) {
$message = __( 'Media attachment permanently deleted.' );
} else {
$message = _n( '%d media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted );
/* translators: %s: number of media attachments */
$message = _n( '%s media attachment permanently deleted.', '%s media attachments permanently deleted.', $deleted );
}
$message = sprintf( $message, number_format_i18n( $deleted ) );
$_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
@ -258,7 +271,8 @@ if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) {
if ( 1 == $trashed ) {
$message = __( 'Media attachment moved to the trash.' );
} else {
$message = _n( '%d media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed );
/* translators: %s: number of media attachments */
$message = _n( '%s media attachment moved to the trash.', '%s media attachments moved to the trash.', $trashed );
}
$message = sprintf( $message, number_format_i18n( $trashed ) );
$message .= ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo') . '</a>';
@ -269,7 +283,8 @@ if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] )
if ( 1 == $untrashed ) {
$message = __( 'Media attachment restored from the trash.' );
} else {
$message = _n( '%d media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed );
/* translators: %s: number of media attachments */
$message = _n( '%s media attachment restored from the trash.', '%s media attachments restored from the trash.', $untrashed );
}
$message = sprintf( $message, number_format_i18n( $untrashed ) );
$_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']);