WordPress.org

Make WordPress Core

Changeset 36328


Ignore:
Timestamp:
01/15/2016 10:28:15 PM (4 years ago)
Author:
ocean90
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r36092 r36328  
    14841484    <div id="find-posts" class="find-box" style="display: none;">
    14851485        <div id="find-posts-head" class="find-box-head">
    1486             <?php _e( 'Find Posts or Pages' ); ?>
     1486            <?php _e( 'Attach to existing content' ); ?>
    14871487            <div id="find-posts-close"></div>
    14881488        </div>
  • trunk/src/wp-admin/upload.php

    r36302 r36328  
    183183'content'   =>
    184184    '<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>' .
    185     '<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>' .
     185    '<p>' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '</p>' .
    186186    '<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>'
    187187) );
     
    236236
    237237if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) {
    238     $message = sprintf( _n( 'Reattached %d attachment.', 'Reattached %d attachments.', $attached ), $attached );
     238    if ( 1 == $attached ) {
     239        $message = __( 'Media attachment reattached.' );
     240    } else {
     241        /* translators: %s: number of media attachments */
     242        $message = _n( '%s media attachment reattached.', '%s media attachments reattached.', $attached );
     243    }
     244    $message = sprintf( $message, number_format_i18n( $attached ) );
    239245    $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
    240246}
    241247
    242248if ( ! empty( $_GET['detach'] ) && $detached = absint( $_GET['detach'] ) ) {
    243     $message = sprintf( _n( 'Detached %d attachment.', 'Detached %d attachments.', $detached ), $detached );
     249    if ( 1 == $detached ) {
     250        $message = __( 'Media attachment detached.' );
     251    } else {
     252        /* translators: %s: number of media attachments */
     253        $message = _n( '%s media attachment detached.', '%s media attachments detached.', $detached );
     254    }
     255    $message = sprintf( $message, number_format_i18n( $detached ) );
    244256    $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
    245257}
     
    249261        $message = __( 'Media attachment permanently deleted.' );
    250262    } else {
    251         $message = _n( '%d media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted );
     263        /* translators: %s: number of media attachments */
     264        $message = _n( '%s media attachment permanently deleted.', '%s media attachments permanently deleted.', $deleted );
    252265    }
    253266    $message = sprintf( $message, number_format_i18n( $deleted ) );
     
    259272        $message = __( 'Media attachment moved to the trash.' );
    260273    } else {
    261         $message = _n( '%d media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed );
     274        /* translators: %s: number of media attachments */
     275        $message = _n( '%s media attachment moved to the trash.', '%s media attachments moved to the trash.', $trashed );
    262276    }
    263277    $message = sprintf( $message, number_format_i18n( $trashed ) );
     
    270284        $message = __( 'Media attachment restored from the trash.' );
    271285    } else {
    272         $message = _n( '%d media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed );
     286        /* translators: %s: number of media attachments */
     287        $message = _n( '%s media attachment restored from the trash.', '%s media attachments restored from the trash.', $untrashed );
    273288    }
    274289    $message = sprintf( $message, number_format_i18n( $untrashed ) );
Note: See TracChangeset for help on using the changeset viewer.