Skip to content
Permalink
Browse files

Accessibility: Posts, Post Types: Replace `@` with `at` in the displa…

…yed 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46083 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Sep 8, 2019
1 parent 4bd76c1 commit acadc5cfdd1e3b984512fa0edbedec6afc08b693
@@ -166,8 +166,14 @@
}
/* translators: Publish box date format, see https://secure.php.net/date */
$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
$scheduled_date = sprintf(
/* translators: Publish box date string. 1: Date, 2: Time. */
__( '%1$s at %2$s' ),
/* translators: Publish box date format, see https://secure.php.net/date */
date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
/* translators: Publish box time format, see https://secure.php.net/date */
date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
);
$messages['post'] = array(
0 => '', // Unused. Messages start at index 1.
@@ -194,28 +194,41 @@ function post_submit_meta_box( $post, $args = array() ) {
</div><!-- .misc-pub-section -->

<?php
/* translators: Publish box date string. 1: Date, 2: Time. See https://secure.php.net/date */
$date_string = __( '%1$s at %2$s' );
/* translators: Publish box date format, see https://secure.php.net/date */
$datef = __( 'M j, Y @ H:i' );
$date_format = _x( 'M j, Y', 'publish box date format' );
/* translators: Publish box time format, see https://secure.php.net/date */
$time_format = _x( 'H:i', 'publish box time format' );
if ( 0 != $post->ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
$stamp = __( 'Scheduled for: <b>%s</b>' );
$stamp = __( 'Scheduled for: %s' );
} elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
/* translators: Post date information. %s: Date on which the post was published. */
$stamp = __( 'Published on: <b>%s</b>' );
$stamp = __( 'Published on: %s' );
} elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
$stamp = __( 'Publish <b>immediately</b>' );
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
/* translators: Post date information. %s: Date on which the post is to be published. */
$stamp = __( 'Schedule for: <b>%s</b>' );
$stamp = __( 'Schedule for: %s' );
} else { // draft, 1 or more saves, date specified
/* translators: Post date information. %s: Date on which the post is to be published. */
$stamp = __( 'Publish on: <b>%s</b>' );
$stamp = __( 'Publish on: %s' );
}
$date = date_i18n( $datef, strtotime( $post->post_date ) );
$date = sprintf(
$date_string,
date_i18n( $date_format, strtotime( $post->post_date ) ),
date_i18n( $time_format, strtotime( $post->post_date ) )
);
} else { // draft (no saves, and thus no date specified)
$stamp = __( 'Publish <b>immediately</b>' );
$date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) );
$date = sprintf(
$date_string,
date_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ),
date_i18n( $time_format, strtotime( current_time( 'mysql' ) ) )
);
}
if ( ! empty( $args['args']['revisions_count'] ) ) :
@@ -234,10 +247,14 @@ function post_submit_meta_box( $post, $args = array() ) {
?>
<div class="misc-pub-section curtime misc-pub-curtime">
<span id="timestamp">
<?php printf( $stamp, $date ); ?></span>
<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>
<?php printf( $stamp, '<b>' . $date . '</b>' ); ?>
</span>
<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>
<fieldset id="timestampdiv" class="hide-if-js">
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<?php touch_time( ( $action === 'edit' ), 1 ); ?>
</fieldset>
</div><?php // /misc-pub-section ?>
@@ -824,7 +824,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
echo '<div class="timestamp-wrap">';
/* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
printf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
@@ -1583,7 +1583,7 @@ function wp_default_scripts( &$scripts ) {
'publishOnFuture' => __( 'Schedule for:' ),
'publishOnPast' => __( 'Published on:' ),
/* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
'dateFormat' => __( '%1$s %2$s, %3$s at %4$s:%5$s' ),
'showcomm' => __( 'Show more comments' ),
'endcomm' => __( 'No more comments found.' ),
'publish' => __( 'Publish' ),

0 comments on commit acadc5c

Please sign in to comment.
You can’t perform that action at this time.