Make WordPress Core

Changeset 46083


Ignore:
Timestamp:
09/08/2019 11:23:26 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Accessibility: Posts, Post Types: Replace @ with at in the displayed date format.

The @ symbol makes sense in the context of email addresses, but does not have a universal meaning in the context of dates.

Props birgire, afercia, audrasjb, SergeyBiryukov.
Fixes #47832.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r45932 r46083  
    167167}
    168168
    169 /* translators: Publish box date format, see https://secure.php.net/date */
    170 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
     169$scheduled_date = sprintf(
     170    /* translators: Publish box date string. 1: Date, 2: Time. */
     171    __( '%1$s at %2$s' ),
     172    /* translators: Publish box date format, see https://secure.php.net/date */
     173    date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
     174    /* translators: Publish box time format, see https://secure.php.net/date */
     175    date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
     176);
    171177
    172178$messages['post']       = array(
  • trunk/src/wp-admin/includes/meta-boxes.php

    r46071 r46083  
    195195
    196196    <?php
     197    /* translators: Publish box date string. 1: Date, 2: Time. See https://secure.php.net/date */
     198    $date_string = __( '%1$s at %2$s' );
    197199    /* translators: Publish box date format, see https://secure.php.net/date */
    198     $datef = __( 'M j, Y @ H:i' );
     200    $date_format = _x( 'M j, Y', 'publish box date format' );
     201    /* translators: Publish box time format, see https://secure.php.net/date */
     202    $time_format = _x( 'H:i', 'publish box time format' );
     203
    199204    if ( 0 != $post->ID ) {
    200205        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    201206            /* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
    202             $stamp = __( 'Scheduled for: <b>%s</b>' );
     207            $stamp = __( 'Scheduled for: %s' );
    203208        } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
    204209            /* translators: Post date information. %s: Date on which the post was published. */
    205             $stamp = __( 'Published on: <b>%s</b>' );
     210            $stamp = __( 'Published on: %s' );
    206211        } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
    207212            $stamp = __( 'Publish <b>immediately</b>' );
    208213        } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
    209214            /* translators: Post date information. %s: Date on which the post is to be published. */
    210             $stamp = __( 'Schedule for: <b>%s</b>' );
     215            $stamp = __( 'Schedule for: %s' );
    211216        } else { // draft, 1 or more saves, date specified
    212217            /* translators: Post date information. %s: Date on which the post is to be published. */
    213             $stamp = __( 'Publish on: <b>%s</b>' );
    214         }
    215         $date = date_i18n( $datef, strtotime( $post->post_date ) );
     218            $stamp = __( 'Publish on: %s' );
     219        }
     220        $date = sprintf(
     221            $date_string,
     222            date_i18n( $date_format, strtotime( $post->post_date ) ),
     223            date_i18n( $time_format, strtotime( $post->post_date ) )
     224        );
    216225    } else { // draft (no saves, and thus no date specified)
    217226        $stamp = __( 'Publish <b>immediately</b>' );
    218         $date  = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) );
     227        $date  = sprintf(
     228            $date_string,
     229            date_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ),
     230            date_i18n( $time_format, strtotime( current_time( 'mysql' ) ) )
     231        );
    219232    }
    220233
     
    235248<div class="misc-pub-section curtime misc-pub-curtime">
    236249    <span id="timestamp">
    237         <?php printf( $stamp, $date ); ?></span>
    238     <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
     250        <?php printf( $stamp, '<b>' . $date . '</b>' ); ?>
     251    </span>
     252    <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button">
     253        <span aria-hidden="true"><?php _e( 'Edit' ); ?></span>
     254        <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span>
     255    </a>
    239256    <fieldset id="timestampdiv" class="hide-if-js">
    240     <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
     257        <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
    241258        <?php touch_time( ( $action === 'edit' ), 1 ); ?>
    242259    </fieldset>
  • trunk/src/wp-admin/includes/template.php

    r45932 r46083  
    825825    echo '<div class="timestamp-wrap">';
    826826    /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    827     printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
     827    printf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
    828828
    829829    echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
  • trunk/src/wp-includes/script-loader.php

    r46075 r46083  
    15841584                'publishOnPast'      => __( 'Published on:' ),
    15851585                /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
    1586                 'dateFormat'         => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
     1586                'dateFormat'         => __( '%1$s %2$s, %3$s at %4$s:%5$s' ),
    15871587                'showcomm'           => __( 'Show more comments' ),
    15881588                'endcomm'            => __( 'No more comments found.' ),
Note: See TracChangeset for help on using the changeset viewer.