Make WordPress Core

Ticket #44360: 44360-wp-admin-includes-dir-patch2.diff

File 44360-wp-admin-includes-dir-patch2.diff, 16.0 KB (added by flipkeijzer, 7 years ago)

Second batch of admin/includes folder patches

  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    773773         * @param WP_Comment $comment The comment object.
    774774         */
    775775        public function column_date( $comment ) {
    776                 /* translators: 1: comment date, 2: comment time */
    777776                $submitted = sprintf(
     777                        /* translators: 1: comment date, 2: comment time */
    778778                        __( '%1$s at %2$s' ),
    779779                        /* translators: comment date format. See https://secure.php.net/date */
    780780                        get_comment_date( __( 'Y/m/d' ), $comment ),
  • src/wp-admin/includes/class-wp-filesystem-ftpext.php

     
    7979                if ( ! $this->link ) {
    8080                        $this->errors->add(
    8181                                'connect',
    82                                 /* translators: %s: hostname:port */
    8382                                sprintf(
     83                                        /* translators: %s: hostname:port */
    8484                                        __( 'Failed to connect to FTP Server %s' ),
    8585                                        $this->options['hostname'] . ':' . $this->options['port']
    8686                                )
     
    9191                if ( ! @ftp_login( $this->link, $this->options['username'], $this->options['password'] ) ) {
    9292                        $this->errors->add(
    9393                                'auth',
    94                                 /* translators: %s: username */
    9594                                sprintf(
     95                                        /* translators: %s: username */
    9696                                        __( 'Username/Password incorrect for %s' ),
    9797                                        $this->options['username']
    9898                                )
  • src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

     
    7171                if ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) {
    7272                        $this->errors->add(
    7373                                'connect',
    74                                 /* translators: %s: hostname:port */
    7574                                sprintf(
     75                                        /* translators: %s: hostname:port */
    7676                                        __( 'Failed to connect to FTP Server %s' ),
    7777                                        $this->options['hostname'] . ':' . $this->options['port']
    7878                                )
     
    8383                if ( ! $this->ftp->connect() ) {
    8484                        $this->errors->add(
    8585                                'connect',
    86                                 /* translators: %s: hostname:port */
    8786                                sprintf(
     87                                        /* translators: %s: hostname:port */
    8888                                        __( 'Failed to connect to FTP Server %s' ),
    8989                                        $this->options['hostname'] . ':' . $this->options['port']
    9090                                )
     
    9595                if ( ! $this->ftp->login( $this->options['username'], $this->options['password'] ) ) {
    9696                        $this->errors->add(
    9797                                'auth',
    98                                 /* translators: %s: username */
    9998                                sprintf(
     99                                        /* translators: %s: username */
    100100                                        __( 'Username/Password incorrect for %s' ),
    101101                                        $this->options['username']
    102102                                )
  • src/wp-admin/includes/class-wp-filesystem-ssh2.php

     
    121121                if ( ! $this->link ) {
    122122                        $this->errors->add(
    123123                                'connect',
    124                                 /* translators: %s: hostname:port */
    125124                                sprintf(
     125                                        /* translators: %s: hostname:port */
    126126                                        __( 'Failed to connect to SSH2 Server %s' ),
    127127                                        $this->options['hostname'] . ':' . $this->options['port']
    128128                                )
     
    134134                        if ( ! @ssh2_auth_password( $this->link, $this->options['username'], $this->options['password'] ) ) {
    135135                                $this->errors->add(
    136136                                        'auth',
    137                                         /* translators: %s: username */
    138137                                        sprintf(
     138                                                /* translators: %s: username */
    139139                                                __( 'Username/Password incorrect for %s' ),
    140140                                                $this->options['username']
    141141                                        )
     
    146146                        if ( ! @ssh2_auth_pubkey_file( $this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
    147147                                $this->errors->add(
    148148                                        'auth',
    149                                         /* translators: %s: username */
    150149                                        sprintf(
     150                                                /* translators: %s: username */
    151151                                                __( 'Public and Private keys incorrect for %s' ),
    152152                                                $this->options['username']
    153153                                        )
     
    160160                if ( ! $this->sftp_link ) {
    161161                        $this->errors->add(
    162162                                'connect',
    163                                 /* translators: %s: hostname:port */
    164163                                sprintf(
     164                                        /* translators: %s: hostname:port */
    165165                                        __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %s' ),
    166166                                        $this->options['hostname'] . ':' . $this->options['port']
    167167                                )
     
    206206                if ( ! ( $stream = ssh2_exec( $this->link, $command ) ) ) {
    207207                        $this->errors->add(
    208208                                'command',
    209                                 /* translators: %s: command */
    210209                                sprintf(
     210                                        /* translators: %s: command */
    211211                                        __( 'Unable to perform command: %s' ),
    212212                                        $command
    213213                                )
  • src/wp-admin/includes/class-wp-links-list-table.php

     
    169169         */
    170170        public function column_cb( $link ) {
    171171                ?>
    172                 <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>"><?php echo sprintf( __( 'Select %s' ), $link->link_name ); ?></label>
     172                <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>">
     173                        <?php
     174                        printf(
     175                                /* translators: %s: link name */
     176                                __( 'Select %s' ),
     177                                $link->link_name
     178                        );
     179                        ?>
     180                </label>
    173181                <input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
    174182                <?php
    175183        }
     
    320328
    321329                $actions           = array();
    322330                $actions['edit']   = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
     331                /*translators: %s: link name */
    323332                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . '</a>';
    324333                return $this->row_actions( $actions );
    325334        }
  • src/wp-admin/includes/class-wp-list-table.php

     
    658658                $approved_comments_number = number_format_i18n( $approved_comments );
    659659                $pending_comments_number  = number_format_i18n( $pending_comments );
    660660
    661                 $approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
    662                 $approved_phrase      = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
    663                 $pending_phrase       = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
     661                $approved_only_phrase = sprintf(
     662                        /* translators: %s: number of approved comments */
     663                        _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
     664                $approved_phrase      = sprintf(
     665                        /* translators: %s: number of approved comments */
     666                        _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
     667                $pending_phrase       = sprintf(
     668                        /* translators: %s: number of pending comments */
     669                        _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
    664670
    665671                // No comments at all.
    666672                if ( ! $approved_comments && ! $pending_comments ) {
     
    785791                        $this->screen->render_screen_reader_content( 'heading_pagination' );
    786792                }
    787793
    788                 $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
     794                $output = '<span class="displaying-num">' . sprintf(
     795                        /* translators: %s: number total items */
     796                        _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    789797
    790798                $current              = $this->get_pagenum();
    791799                $removable_query_args = wp_removable_query_args();
     
    850858                        );
    851859                }
    852860                $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    853                 $page_links[]     = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
     861                $page_links[]     = $total_pages_before . sprintf(
     862                        /* translators: 1: current page, 2: total pages */
     863                        _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages
     864                ) . $total_pages_after;
    854865
    855866                if ( $disable_next ) {
    856867                        $page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">&rsaquo;</span>';
     
    13661377
    13671378                if ( isset( $this->_pagination_args['total_items'] ) ) {
    13681379                        $response['total_items_i18n'] = sprintf(
     1380                                /* translators: %s: number of total items */
    13691381                                _n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
    13701382                                number_format_i18n( $this->_pagination_args['total_items'] )
    13711383                        );
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    357357                ?>
    358358                        <label class="screen-reader-text" for="cb-select-<?php echo $post->ID; ?>">
    359359                                                                                                                                                <?php
    360                                                                                                                                                 echo sprintf( __( 'Select %s' ), _draft_or_post_title() );
     360                                                                                                                                                printf(
     361                                                                                                                                                        /* translators: %s: post title */
     362                                                                                                                                                        __( 'Select %s' ), _draft_or_post_title() );
    361363                        ?>
    362364                        </label>
    363365                        <input type="checkbox" name="media[]" id="cb-select-<?php echo $post->ID; ?>" value="<?php echo $post->ID; ?>" />
     
    454456                        $time   = get_post_time( 'G', true, $post, false );
    455457                        if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
    456458                                if ( $t_diff < 0 ) {
    457                                         $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
     459                                        $h_time = sprintf(
     460                                                /* translators: %s: Human readable time difference */
     461                                                __( '%s from now' ), human_time_diff( $time ) );
    458462                                } else {
    459                                         $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
     463                                        $h_time = sprintf(
     464                                                /* translators: %s: Human readable time difference */
     465                                                __( '%s ago' ), human_time_diff( $time ) );
    460466                                }
    461467                        } else {
    462468                                $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
  • src/wp-admin/includes/class-wp-ms-sites-list-table.php

     
    278278                ?>
    279279                        <label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>">
    280280                                                                                                                                        <?php
    281                                                                                                                                         printf( __( 'Select %s' ), $blogname );
     281                                                                                                                                        printf(
     282                                                                                                                                                /* translators: %s: blog name */
     283                                                                                                                                                __( 'Select %s' ), $blogname );
    282284                        ?>
    283285                        </label>
    284286                        <input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" />
  • src/wp-admin/includes/class-wp-ms-themes-list-table.php

     
    297297
    298298                        switch ( $type ) {
    299299                                case 'all':
    300                                         $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
     300                                        $text =
     301                                                /* translators: %s: number */
     302                                                _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
    301303                                        break;
    302304                                case 'enabled':
    303                                         $text = _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
     305                                        $text =
     306                                                /* translators: %s: number */
     307                                                _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
    304308                                        break;
    305309                                case 'disabled':
    306                                         $text = _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
     310                                        $text =
     311                                                /* translators: %s: number */
     312                                                _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
    307313                                        break;
    308314                                case 'upgrade':
    309                                         $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
     315                                        $text =
     316                                                /* translators: %s: number */
     317                                                _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
    310318                                        break;
    311319                                case 'broken':
    312                                         $text = _n( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count );
     320                                        $text =
     321                                                /* translators: %s: number */
     322                                                _n( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count );
    313323                                        break;
    314324                        }
    315325
     
    566576                $theme_meta = array();
    567577
    568578                if ( $theme->get( 'Version' ) ) {
    569                         $theme_meta[] = sprintf( __( 'Version %s' ), $theme->display( 'Version' ) );
    570                 }
    571                 $theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );
     579                        $theme_meta[] = sprintf(
     580                                /* translators: %s: Theme version */
     581                                __( 'Version %s' ), $theme->display( 'Version' ) );
     582                }
     583                $theme_meta[] = sprintf(
     584                        /* translators: %s: Author */
     585                        __( 'By %s' ), $theme->display( 'Author' ) );
    572586
    573587                if ( $theme->get( 'ThemeURI' ) ) {
    574588                        /* translators: %s: theme name */
  • src/wp-admin/includes/class-wp-ms-users-list-table.php

     
    139139
    140140                $current_link_attributes = $role !== 'super' ? ' class="current" aria-current="page"' : '';
    141141                $role_links              = array();
    142                 $role_links['all']       = "<a href='" . network_admin_url( 'users.php' ) . "'$current_link_attributes>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
     142                $role_links['all']       = "<a href='" . network_admin_url( 'users.php' ) . "'$current_link_attributes>" . sprintf(
     143                        /* translators: %s: total number of users */
     144                        _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
    143145                $current_link_attributes = $role === 'super' ? ' class="current" aria-current="page"' : '';
    144                 $role_links['super']     = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
     146                $role_links['super']     = "<a href='" . network_admin_url( 'users.php?role=super' ) . "'$current_link_attributes>" . sprintf(
     147                        /* translators: %s: total number of admins */
     148                        _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
    145149
    146150                return $role_links;
    147151        }
     
    208212                        return;
    209213                }
    210214                ?>
    211                 <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>"><?php echo sprintf( __( 'Select %s' ), $user->user_login ); ?></label>
     215                <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>"><?php
     216                        printf(
     217                                /* translators: %S: user login name */
     218                                __( 'Select %s' ), $user->user_login ); ?></label>
    212219                <input type="checkbox" id="blog_<?php echo $user->ID; ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ); ?>" />
    213220                <?php
    214221        }