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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-09-08 23:23:26 +00:00
parent 4bd76c15b5
commit acadc5cfdd
4 changed files with 37 additions and 14 deletions
+27 -10
View File
@@ -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 @@ endif;
?>
<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 ?>