Make WordPress Core


Ignore:
Timestamp:
09/03/2019 12:39:13 AM (7 years ago)
Author:
SergeyBiryukov
Message:

I18N: Capitalize translator comments consistently, add trailing punctuation.

Includes minor code layout fixes.

See #44360.

File:
1 edited

Legend:

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

    r45926 r45932  
    270270                if ( $num_posts && $num_posts->publish ) {
    271271                        if ( 'post' == $post_type ) {
    272                                 /* translators: %s: number of posts */
     272                                /* translators: %s: Number of posts. */
    273273                                $text = _n( '%s Post', '%s Posts', $num_posts->publish );
    274274                        } else {
    275                                 /* translators: %s: number of pages */
     275                                /* translators: %s: Number of pages. */
    276276                                $text = _n( '%s Page', '%s Pages', $num_posts->publish );
    277277                        }
     
    288288        $num_comm = wp_count_comments();
    289289        if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
    290                 /* translators: %s: number of comments */
     290                /* translators: %s: Number of comments. */
    291291                $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
    292292                ?>
     
    294294                <?php
    295295                $moderated_comments_count_i18n = number_format_i18n( $num_comm->moderated );
    296                 /* translators: %s: number of comments */
     296                /* translators: %s: Number of comments. */
    297297                $text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $num_comm->moderated ), $moderated_comments_count_i18n );
    298298                ?>
     
    413413        $c_blogs = get_blog_count();
    414414
    415         /* translators: %s: number of users on the network */
     415        /* translators: %s: Number of users on the network. */
    416416        $user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
    417         /* translators: %s: number of sites on the network */
     417        /* translators: %s: Number of sites on the network. */
    418418        $blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
    419419
    420         /* translators: 1: text indicating the number of sites on the network, 2: text indicating the number of users on the network */
     420        /* translators: 1: Text indicating the number of sites on the network, 2: Text indicating the number of users on the network. */
    421421        $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
    422422
     
    603603                        '<div class="draft-title"><a href="%s" aria-label="%s">%s</a><time datetime="%s">%s</time></div>',
    604604                        esc_url( $url ),
    605                         /* translators: %s: post title */
     605                        /* translators: %s: Post title. */
    606606                        esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
    607607                        esc_html( $title ),
     
    664664                $delete_url    = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    665665
    666                 $actions['approve']   = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a aria-button-if-js' aria-label='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    667                 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u aria-button-if-js' aria-label='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    668                 $actions['edit']      = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' aria-label='" . esc_attr__( 'Edit this comment' ) . "'>" . __( 'Edit' ) . '</a>';
    669                 $actions['reply']     = '<button type="button" onclick="window.commentReply && commentReply.open(\'' . $comment->comment_ID . '\',\'' . $comment->comment_post_ID . '\');" class="vim-r button-link hide-if-no-js" aria-label="' . esc_attr__( 'Reply to this comment' ) . '">' . __( 'Reply' ) . '</button>';
    670                 $actions['spam']      = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
     666                $actions['approve'] = sprintf(
     667                        '<a href="%s" data-wp-lists="%s" class="vim-a aria-button-if-js" aria-label="%s">%s</a>',
     668                        $approve_url,
     669                        "dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved",
     670                        esc_attr__( 'Approve this comment' ),
     671                        __( 'Approve' )
     672                );
     673
     674                $actions['unapprove'] = sprintf(
     675                        '<a href="%s" data-wp-lists="%s" class="vim-u aria-button-if-js" aria-label="%s">%s</a>',
     676                        $unapprove_url,
     677                        "dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved",
     678                        esc_attr__( 'Unapprove this comment' ),
     679                        __( 'Unapprove' )
     680                );
     681
     682                $actions['edit'] = sprintf(
     683                        '<a href="%s" aria-label="%s">%s</a>',
     684                        "comment.php?action=editcomment&amp;c={$comment->comment_ID}",
     685                        esc_attr__( 'Edit this comment' ),
     686                        __( 'Edit' )
     687                );
     688
     689                $actions['reply'] = sprintf(
     690                        '<button type="button" onclick="window.commentReply && commentReply.open(\'%s\',\'%s\');" class="vim-r button-link hide-if-no-js" aria-label="%s">%s</button>',
     691                        $comment->comment_ID,
     692                        $comment->comment_post_ID,
     693                        esc_attr__( 'Reply to this comment' ),
     694                        __( 'Reply' )
     695                );
     696
     697                $actions['spam'] = sprintf(
     698                        '<a href="%s" data-wp-lists="%s" class="vim-s vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     699                        $spam_url,
     700                        "delete:the-comment-list:comment-{$comment->comment_ID}::spam=1",
     701                        esc_attr__( 'Mark this comment as spam' ),
     702                        /* translators: "Mark as spam" link. */
     703                        _x( 'Spam', 'verb' )
     704                );
    671705
    672706                if ( ! EMPTY_TRASH_DAYS ) {
    673                         $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Delete this comment permanently' ) . "'>" . __( 'Delete Permanently' ) . '</a>';
     707                        $actions['delete'] = sprintf(
     708                                '<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     709                                $delete_url,
     710                                "delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
     711                                esc_attr__( 'Delete this comment permanently' ),
     712                                __( 'Delete Permanently' )
     713                        );
    674714                } else {
    675                         $actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive aria-button-if-js' aria-label='" . esc_attr__( 'Move this comment to the Trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
    676                 }
    677 
    678                 $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
     715                        $actions['trash'] = sprintf(
     716                                '<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
     717                                $trash_url,
     718                                "delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
     719                                esc_attr__( 'Move this comment to the Trash' ),
     720                                _x( 'Trash', 'verb' )
     721                        );
     722                }
     723
     724                $actions['view'] = sprintf(
     725                        '<a class="comment-link" href="%s" aria-label="%s">%s</a>',
     726                        esc_url( get_comment_link( $comment ) ),
     727                        esc_attr__( 'View this comment' ),
     728                        __( 'View' )
     729                );
    679730
    680731                /**
     
    721772                                if ( $comment_post_link ) {
    722773                                        printf(
    723                                                 /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
     774                                                /* translators: 1: Comment author, 2: Post link, 3: Notification if the comment is pending. */
    724775                                                __( 'From %1$s on %2$s %3$s' ),
    725776                                                '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
     
    729780                                } else {
    730781                                        printf(
    731                                                 /* translators: 1: comment author, 2: notification if the comment is pending */
     782                                                /* translators: 1: Comment author, 2: Notification if the comment is pending. */
    732783                                                __( 'From %1$s %2$s' ),
    733784                                                '<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
     
    758809                                if ( $comment_post_link ) {
    759810                                        printf(
    760                                                 /* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
     811                                                /* translators: 1: Type of comment, 2: Post link, 3: Notification if the comment is pending. */
    761812                                                _x( '%1$s on %2$s %3$s', 'dashboard' ),
    762813                                                "<strong>$type</strong>",
     
    766817                                } else {
    767818                                        printf(
    768                                                 /* translators: 1: type of comment, 2: notification if the comment is pending */
     819                                                /* translators: 1: Type of comment, 2: Notification if the comment is pending. */
    769820                                                _x( '%1$s %2$s', 'dashboard' ),
    770821                                                "<strong>$type</strong>",
     
    886937                                $relative = __( 'Tomorrow' );
    887938                        } elseif ( gmdate( 'Y', $time ) !== $year ) {
    888                                 /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
     939                                /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
    889940                                $relative = date_i18n( __( 'M jS Y' ), $time );
    890941                        } else {
    891                                 /* translators: date and time format for recent posts on the dashboard, see https://secure.php.net/date */
     942                                /* translators: Date and time format for recent posts on the dashboard, see https://secure.php.net/date */
    892943                                $relative = date_i18n( __( 'M jS' ), $time );
    893944                        }
     
    899950                        printf(
    900951                                '<li><span>%1$s</span> <a href="%2$s" aria-label="%3$s">%4$s</a></li>',
    901                                 /* translators: 1: relative date, 2: time */
     952                                /* translators: 1: Relative date, 2: Time. */
    902953                                sprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, get_the_time() ),
    903954                                $recent_post_link,
    904                                 /* translators: %s: post title */
     955                                /* translators: %s: Post title. */
    905956                                esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $draft_or_post_title ) ),
    906957                                $draft_or_post_title
     
    11471198                                'https://make.wordpress.org/community/meetups-landing-page',
    11481199                                __( 'Meetups' ),
    1149                                 /* translators: accessibility text */
     1200                                /* translators: Accessibility text. */
    11501201                                __( '(opens in a new tab)' )
    11511202                        );
     
    11591210                                'https://central.wordcamp.org/schedule/',
    11601211                                __( 'WordCamps' ),
    1161                                 /* translators: accessibility text */
     1212                                /* translators: Accessibility text. */
    11621213                                __( '(opens in a new tab)' )
    11631214                        );
     
    11721223                                esc_url( _x( 'https://wordpress.org/news/', 'Events and News dashboard widget' ) ),
    11731224                                __( 'News' ),
    1174                                 /* translators: accessibility text */
     1225                                /* translators: Accessibility text. */
    11751226                                __( '(opens in a new tab)' )
    11761227                        );
     
    12641315                <?php
    12651316                printf(
    1266                         /* translators: %s: the name of a city */
     1317                        /* translators: %s: The name of a city. */
    12671318                        __( 'Attend an upcoming event near %s.' ),
    12681319                        '<strong>{{ data.location.description }}</strong>'
     
    13111362                                <?php
    13121363                                printf(
    1313                                         /* translators: 1: the city the user searched for, 2: meetup organization documentation URL */
     1364                                        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
    13141365                                        __( 'There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?' ),
    13151366                                        '{{ data.location.description }}',
     
    13211372                                <?php
    13221373                                printf(
    1323                                         /* translators: %s: meetup organization documentation URL */
     1374                                        /* translators: %s: Meetup organization documentation URL. */
    13241375                                        __( 'There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize one</a>?' ),
    13251376                                        __( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
     
    14701521                        <?php
    14711522                        $text = sprintf(
    1472                                 /* translators: %s: number of megabytes */
     1523                                /* translators: %s: Number of megabytes. */
    14731524                                __( '%s MB Space Allowed' ),
    14741525                                number_format_i18n( $quota )
     
    14841535                        <?php
    14851536                        $text = sprintf(
    1486                                 /* translators: 1: number of megabytes, 2: percentage */
     1537                                /* translators: 1: Number of megabytes, 2: Percentage. */
    14871538                                __( '%1$s MB (%2$s%%) Space Used' ),
    14881539                                number_format_i18n( $used, 2 ),
     
    15101561                if ( $response['insecure'] ) {
    15111562                        $msg = sprintf(
    1512                                 /* translators: %s: browser name and link */
     1563                                /* translators: %s: Browser name and link. */
    15131564                                __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
    15141565                                sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
     
    15161567                } else {
    15171568                        $msg = sprintf(
    1518                                 /* translators: %s: browser name and link */
     1569                                /* translators: %s: Browser name and link. */
    15191570                                __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
    15201571                                sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
     
    15381589
    15391590                $notice .= '<p>' . sprintf(
    1540                         /* translators: 1: browser update URL, 2: browser name, 3: Browse Happy URL */
     1591                        /* translators: 1: Browser update URL, 2: Browser name, 3: Browse Happy URL. */
    15411592                        __( '<a href="%1$s" class="update-browser-link">Update %2$s</a> or learn how to <a href="%3$s" class="browse-happy-link">browse happy</a>' ),
    15421593                        esc_attr( $response['update_url'] ),
     
    16641715                        esc_url( wp_get_update_php_url() ),
    16651716                        __( 'Learn more about updating PHP' ),
    1666                         /* translators: accessibility text */
     1717                        /* translators: Accessibility text. */
    16671718                        __( '(opens in a new tab)' )
    16681719                );
     
    17191770                        <p class="hide-if-no-customize">
    17201771                                <?php
    1721                                         /* translators: %s: URL to Themes panel in Customizer or Themes screen */
     1772                                        /* translators: %s: URL to Themes panel in Customizer or Themes screen. */
    17221773                                        printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link );
    17231774                                ?>
     
    17501801                        if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
    17511802                                $widgets_menus_link = sprintf(
    1752                                         /* translators: 1: URL to Widgets screen, 2: URL to Menus screen */
     1803                                        /* translators: 1: URL to Widgets screen, 2: URL to Menus screen. */
    17531804                                        __( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
    17541805                                        admin_url( 'widgets.php' ),
Note: See TracChangeset for help on using the changeset viewer.