<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[57136] trunk/src: I18N: Improve translator comments for strings containing date formats.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/57136">57136</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/57136","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>swissspidy</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-11-26 16:41:34 +0000 (Sun, 26 Nov 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="https://core.trac.wordpress.org/ticket/59947">#59947</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmineditformadvancedphp">trunk/src/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesmetaboxesphp">trunk/src/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunksrcwpadminupdatecorephp">trunk/src/wp-admin/update-core.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludesthemecompatsidebarphp">trunk/src/wp-includes/theme-compat/sidebar.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmineditformadvancedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/edit-form-advanced.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-form-advanced.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-admin/edit-form-advanced.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -649,11 +649,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<span id="last-edit">';
</span><span class="cx" style="display: block; padding: 0 10px"> $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $last_user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* 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 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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 )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* 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 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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 )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</span>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1628,9 +1628,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_type'] = $post->post_type;
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data['post_status'] = 'draft';
</span><span class="cx" style="display: block; padding: 0 10px"> $now = time();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* 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 ) );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $pid = edit_post( $post_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $pid ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/meta-boxes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/meta-boxes.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-admin/includes/meta-boxes.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <span id="timestamp">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $uploaded_on = sprintf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: Publish box date string. 1: Date, 2: Time. */
</ins><span class="cx" style="display: block; padding: 0 10px"> __( '%1$s at %2$s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
</span><span class="cx" style="display: block; padding: 0 10px"> date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
</span></span></pre></div>
<a id="trunksrcwpadminupdatecorephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/update-core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/update-core.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-admin/update-core.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1105,8 +1105,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</h2>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<p class="update-last-checked">';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* 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 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ 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 )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> echo ' <a href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check again.' ) . '</a>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-includes/general-template.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1715,12 +1715,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $title = get_the_author();
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = _x( 'Author:', 'author archive title prefix' );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_year() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: See https://www.php.net/manual/datetime.format.php */
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = get_the_date( _x( 'Y', 'yearly archives date format' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = _x( 'Year:', 'date archive title prefix' );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_month() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: See https://www.php.net/manual/datetime.format.php */
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = get_the_date( _x( 'F Y', 'monthly archives date format' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = _x( 'Month:', 'date archive title prefix' );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_day() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: See https://www.php.net/manual/datetime.format.php */
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = get_the_date( _x( 'F j, Y', 'daily archives date format' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $prefix = _x( 'Day:', 'date archive title prefix' );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_tax( 'post_format' ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesthemecompatsidebarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme-compat/sidebar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme-compat/sidebar.php 2023-11-25 21:17:28 UTC (rev 57135)
+++ trunk/src/wp-includes/theme-compat/sidebar.php 2023-11-26 16:41:34 UTC (rev 57136)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,6 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: Site link, 2: Archive date. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: Daily archives date format. See https://www.php.net/manual/datetime.format.php */
</ins><span class="cx" style="display: block; padding: 0 10px"> get_the_time( __( 'l, F jS, Y' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,6 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: Site link, 2: Archive month. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You are currently browsing the %1$s blog archives for %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: Monthly archives date format. See https://www.php.net/manual/datetime.format.php */
</ins><span class="cx" style="display: block; padding: 0 10px"> get_the_time( __( 'F, Y' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre>
</div>
</div>
</body>
</html>