From eb5c155700860f91449dafbae744084b6eb00cca Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 26 Nov 2023 16:43:30 +0000 Subject: [PATCH] I18N: Improve translator comments for strings containing date formats. Adds translator comments where absent and changes code style so that comments are attached to the right strings during string extraction. Props NekoJonez. Fixes #59947 Built from https://develop.svn.wordpress.org/trunk@57136 git-svn-id: http://core.svn.wordpress.org/trunk@56647 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 17 +++++++++++++---- wp-admin/includes/ajax-actions.php | 9 +++++++-- wp-admin/includes/meta-boxes.php | 2 +- wp-admin/update-core.php | 11 +++++++++-- wp-includes/general-template.php | 3 +++ wp-includes/theme-compat/sidebar.php | 2 ++ wp-includes/version.php | 2 +- 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index dc3623606c..16b699ca39 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -649,11 +649,20 @@ if ( post_type_supports( $post_type, 'editor' ) ) { echo ''; $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ); if ( $last_user ) { - /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */ - printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); + printf( + /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */ + __( 'Last edited by %1$s on %2$s at %3$s' ), + esc_html( $last_user->display_name ), + mysql2date( __( 'F j, Y' ), $post->post_modified ), + mysql2date( __( 'g:i a' ), $post->post_modified ) + ); } else { - /* translators: 1: Post edited date, 2: Post edited time. */ - printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); + printf( + /* translators: 1: Post edited date, 2: Post edited time. */ + __( 'Last edited on %1$s at %2$s' ), + mysql2date( __( 'F j, Y' ), $post->post_modified ), + mysql2date( __( 'g:i a' ), $post->post_modified ) + ); } echo ''; } diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 69f5fd469c..b8e8246eb7 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1628,8 +1628,13 @@ function wp_ajax_add_meta() { $post_data['post_type'] = $post->post_type; $post_data['post_status'] = 'draft'; $now = time(); - /* translators: 1: Post creation date, 2: Post creation time. */ - $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), gmdate( __( 'F j, Y' ), $now ), gmdate( __( 'g:i a' ), $now ) ); + + $post_data['post_title'] = sprintf( + /* translators: 1: Post creation date, 2: Post creation time. */ + __( 'Draft created on %1$s at %2$s' ), + gmdate( __( 'F j, Y' ), $now ), + gmdate( __( 'g:i a' ), $now ) + ); $pid = edit_post( $post_data ); diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 5228076079..387910e918 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -434,7 +434,7 @@ function attachment_submit_meta_box( $post ) { post_date ) ), diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 7ff74569be..c34ac06f24 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -1105,8 +1105,15 @@ if ( 'upgrade-core' === $action ) { echo ''; echo '

'; - /* translators: 1: Date, 2: Time. */ - printf( __( 'Last checked on %1$s at %2$s.' ), date_i18n( __( 'F j, Y' ), $last_update_check ), date_i18n( __( 'g:i a T' ), $last_update_check ) ); + + printf( + /* translators: 1: Date, 2: Time. */ + __( 'Last checked on %1$s at %2$s.' ), + /* translators: Last update date format. See https://www.php.net/manual/datetime.format.php */ + date_i18n( __( 'F j, Y' ), $last_update_check ), + /* translators: Last update time format. See https://www.php.net/manual/datetime.format.php */ + date_i18n( __( 'g:i a T' ), $last_update_check ) + ); echo ' ' . __( 'Check again.' ) . ''; echo '

'; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 17cce96074..28fb3394d2 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1715,12 +1715,15 @@ function get_the_archive_title() { $title = get_the_author(); $prefix = _x( 'Author:', 'author archive title prefix' ); } elseif ( is_year() ) { + /* translators: See https://www.php.net/manual/datetime.format.php */ $title = get_the_date( _x( 'Y', 'yearly archives date format' ) ); $prefix = _x( 'Year:', 'date archive title prefix' ); } elseif ( is_month() ) { + /* translators: See https://www.php.net/manual/datetime.format.php */ $title = get_the_date( _x( 'F Y', 'monthly archives date format' ) ); $prefix = _x( 'Month:', 'date archive title prefix' ); } elseif ( is_day() ) { + /* translators: See https://www.php.net/manual/datetime.format.php */ $title = get_the_date( _x( 'F j, Y', 'daily archives date format' ) ); $prefix = _x( 'Day:', 'date archive title prefix' ); } elseif ( is_tax( 'post_format' ) ) { diff --git a/wp-includes/theme-compat/sidebar.php b/wp-includes/theme-compat/sidebar.php index da4efaa86c..f27fce5780 100644 --- a/wp-includes/theme-compat/sidebar.php +++ b/wp-includes/theme-compat/sidebar.php @@ -56,6 +56,7 @@ _deprecated_file( /* translators: 1: Site link, 2: Archive date. */ __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ), sprintf( '%2$s', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ), + /* translators: Daily archives date format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'l, F jS, Y' ) ) ); ?> @@ -68,6 +69,7 @@ _deprecated_file( /* translators: 1: Site link, 2: Archive month. */ __( 'You are currently browsing the %1$s blog archives for %2$s.' ), sprintf( '%2$s', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ), + /* translators: Monthly archives date format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'F, Y' ) ) ); ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index 8cb2b53372..f33e0c0cf9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57135'; +$wp_version = '6.5-alpha-57136'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.