Make WordPress Core

Changeset 57136


Ignore:
Timestamp:
11/26/2023 04:41:34 PM (12 months ago)
Author:
swissspidy
Message:

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

Location:
trunk/src
Files:
6 edited

Legend:

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

    r56600 r57136  
    650650        $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
    651651        if ( $last_user ) {
    652             /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */
    653             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 ) );
     652            printf(
     653                /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */
     654                __( 'Last edited by %1$s on %2$s at %3$s' ),
     655                esc_html( $last_user->display_name ),
     656                mysql2date( __( 'F j, Y' ), $post->post_modified ),
     657                mysql2date( __( 'g:i a' ), $post->post_modified )
     658            );
    654659        } else {
    655             /* translators: 1: Post edited date, 2: Post edited time. */
    656             printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
     660            printf(
     661                /* translators: 1: Post edited date, 2: Post edited time. */
     662                __( 'Last edited on %1$s at %2$s' ),
     663                mysql2date( __( 'F j, Y' ), $post->post_modified ),
     664                mysql2date( __( 'g:i a' ), $post->post_modified )
     665            );
    657666        }
    658667        echo '</span>';
  • trunk/src/wp-admin/includes/ajax-actions.php

    r56838 r57136  
    16291629            $post_data['post_status'] = 'draft';
    16301630            $now                      = time();
    1631             /* translators: 1: Post creation date, 2: Post creation time. */
    1632             $post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), gmdate( __( 'F j, Y' ), $now ), gmdate( __( 'g:i a' ), $now ) );
     1631
     1632            $post_data['post_title'] = sprintf(
     1633                /* translators: 1: Post creation date, 2: Post creation time. */
     1634                __( 'Draft created on %1$s at %2$s' ),
     1635                gmdate( __( 'F j, Y' ), $now ),
     1636                gmdate( __( 'g:i a' ), $now )
     1637            );
    16331638
    16341639            $pid = edit_post( $post_data );
  • trunk/src/wp-admin/includes/meta-boxes.php

    r56747 r57136  
    435435            <?php
    436436            $uploaded_on = sprintf(
    437                 /* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
     437                /* translators: Publish box date string. 1: Date, 2: Time. */
    438438                __( '%1$s at %2$s' ),
    439439                /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
  • trunk/src/wp-admin/update-core.php

    r56665 r57136  
    11061106
    11071107    echo '<p class="update-last-checked">';
    1108     /* translators: 1: Date, 2: Time. */
    1109     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 ) );
     1108
     1109    printf(
     1110        /* translators: 1: Date, 2: Time. */
     1111        __( 'Last checked on %1$s at %2$s.' ),
     1112        /* translators: Last update date format. See https://www.php.net/manual/datetime.format.php */
     1113        date_i18n( __( 'F j, Y' ), $last_update_check ),
     1114        /* translators: Last update time format. See https://www.php.net/manual/datetime.format.php */
     1115        date_i18n( __( 'g:i a T' ), $last_update_check )
     1116    );
    11101117    echo ' <a href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check again.' ) . '</a>';
    11111118    echo '</p>';
  • trunk/src/wp-includes/general-template.php

    r57131 r57136  
    17161716        $prefix = _x( 'Author:', 'author archive title prefix' );
    17171717    } elseif ( is_year() ) {
     1718        /* translators: See https://www.php.net/manual/datetime.format.php */
    17181719        $title  = get_the_date( _x( 'Y', 'yearly archives date format' ) );
    17191720        $prefix = _x( 'Year:', 'date archive title prefix' );
    17201721    } elseif ( is_month() ) {
     1722        /* translators: See https://www.php.net/manual/datetime.format.php */
    17211723        $title  = get_the_date( _x( 'F Y', 'monthly archives date format' ) );
    17221724        $prefix = _x( 'Month:', 'date archive title prefix' );
    17231725    } elseif ( is_day() ) {
     1726        /* translators: See https://www.php.net/manual/datetime.format.php */
    17241727        $title  = get_the_date( _x( 'F j, Y', 'daily archives date format' ) );
    17251728        $prefix = _x( 'Day:', 'date archive title prefix' );
  • trunk/src/wp-includes/theme-compat/sidebar.php

    r45932 r57136  
    5757                        __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
    5858                        sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     59                        /* translators: Daily archives date format. See https://www.php.net/manual/datetime.format.php */
    5960                        get_the_time( __( 'l, F jS, Y' ) )
    6061                    );
     
    6970                        __( 'You are currently browsing the %1$s blog archives for %2$s.' ),
    7071                        sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     72                        /* translators: Monthly archives date format. See https://www.php.net/manual/datetime.format.php */
    7173                        get_the_time( __( 'F, Y' ) )
    7274                    );
Note: See TracChangeset for help on using the changeset viewer.