Make WordPress Core

Ticket #35392: 35392.2.patch

File 35392.2.patch, 5.8 KB (added by afercia, 10 years ago)

curly quotes should be translatable

  • src/wp-admin/css/dashboard.css

     
    688688
    689689#activity-widget #the-comment-list .avatar {
    690690        position: absolute;
    691         top: 13px;
     691        top: 12px;
    692692}
    693693
    694694#activity-widget #the-comment-list .dashboard-comment-wrap {
     
    801801}
    802802
    803803#activity-widget #latest-comments #the-comment-list .comment-item {
    804         padding: 1em 12px;
     804        /* the row-actions paragraph is output only for users with 'edit_comment' capabilities,
     805           for other users this needs a min height equal to the gravatar image */
     806        min-height: 50px;
     807        margin: 0;
     808        padding: 12px;
    805809}
    806810
    807811#latest-comments #the-comment-list .pingback {
  • src/wp-admin/css/list-tables.css

     
    896896tr:hover .row-actions,
    897897.mobile .row-actions,
    898898.row-actions.visible,
    899 div.comment-item:hover .row-actions {
     899.comment-item:hover .row-actions {
    900900        position: static;
    901901}
    902902
  • src/wp-admin/includes/dashboard.php

     
    574574function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
    575575        $GLOBALS['comment'] = clone $comment;
    576576
    577         if ( $comment->comment_post_ID > 0 && current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
     577        if ( $comment->comment_post_ID > 0 ) {
     578
    578579                $comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
    579                 $comment_post_url = get_edit_post_link( $comment->comment_post_ID );
    580                 $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
     580
     581                if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
     582                        $comment_post_url = get_edit_post_link( $comment->comment_post_ID );
     583                        $comment_post_link_or_title = "<a href='$comment_post_url'>$comment_post_title</a>";
     584                } else {
     585                        // translators: %s: post title
     586                        $comment_post_link_or_title = sprintf( __( '&#8220;%s&#8221;' ), $comment_post_title );
     587                }
     588
    581589        } else {
    582                 $comment_post_link = '';
     590                $comment_post_link_or_title = '';
    583591        }
    584592
    585593        $actions_string = '';
     
    644652                        $actions_string .= "<span class='$action'>$sep$link</span>";
    645653                }
    646654        }
    647 
    648655?>
    649656
    650                 <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
     657                <li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
    651658
    652659                        <?php echo get_avatar( $comment, 50, 'mystery' ); ?>
    653660
     
    655662
    656663                        <div class="dashboard-comment-wrap has-row-actions">
    657664                        <p class="comment-meta">
    658                                 <?php
    659                                 if ( $comment_post_link ) {
    660                                         printf(
    661                                                 /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
    662                                                 __( 'From %1$s on %2$s%3$s' ),
    663                                                 '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
    664                                                 $comment_post_link,
    665                                                 ' <span class="approve">' . __( '[Pending]' ) . '</span>'
    666                                         );
    667                                 } else {
    668                                         printf(
    669                                                 /* translators: 1: comment author, 2: notification if the comment is pending */
    670                                                 __( 'From %1$s %2$s' ),
    671                                                 '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
    672                                                 ' <span class="approve">' . __( '[Pending]' ) . '</span>'
    673                                         );
    674                                 }
    675                                 ?>
     665                        <?php
     666                                printf(
     667                                        /* translators: 1: comment author, 2: post title, 3: notification if the comment is pending */
     668                                        __( 'From %1$s on %2$s%3$s' ),
     669                                        '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
     670                                        $comment_post_link_or_title,
     671                                        ' <span class="approve" aria-hidden="true">' . __( '[Pending]' ) . '</span>'
     672                                );
     673                        ?>
    676674                        </p>
    677675
    678676                        <?php
     
    690688                                $type = esc_html( $type );
    691689                        ?>
    692690                        <div class="dashboard-comment-wrap has-row-actions">
    693                         <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
    694                         <p class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></p>
     691                        <p class="comment-meta">
     692                        <?php
     693                                /* translators: 1: type of comment, 2: post link or title */
     694                                printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link_or_title );
     695                        ?>
     696                        </p>
    695697                        <p class="comment-author"><?php comment_author_link( $comment ); ?></p>
    696698
    697699                        <?php endif; // comment_type ?>
     700
    698701                        <blockquote><p><?php comment_excerpt( $comment ); ?></p></blockquote>
     702                        <?php if ( $actions_string ) : ?>
    699703                        <p class="row-actions"><?php echo $actions_string; ?></p>
     704                        <?php endif; ?>
    700705                        </div>
    701                 </div>
     706                </li>
    702707<?php
    703708        $GLOBALS['comment'] = null;
    704709}
     
    868873
    869874        if ( $comments ) {
    870875                echo '<div id="latest-comments" class="activity-block">';
    871                 echo '<h3>' . __( 'Comments' ) . '</h3>';
     876                echo '<h3>' . __( 'Recent Comments' ) . '</h3>';
    872877
    873                 echo '<div id="the-comment-list" data-wp-lists="list:comment">';
     878                echo '<ul id="the-comment-list" data-wp-lists="list:comment">';
    874879                foreach ( $comments as $comment )
    875880                        _wp_dashboard_recent_comments_row( $comment );
    876                 echo '</div>';
     881                echo '</ul>';
    877882
    878                 if ( current_user_can('edit_posts') )
    879                         _get_list_table('WP_Comments_List_Table')->views();
     883                if ( current_user_can( 'edit_posts' ) ) {
     884                        echo '<h4 class="screen-reader-text">' . __( 'View more comments' ) . '</h4>';
     885                        _get_list_table( 'WP_Comments_List_Table' )->views();
     886                }
    880887
    881888                wp_comment_reply( -1, false, 'dashboard', false );
    882889                wp_comment_trashnotice();