Make WordPress Core

Ticket #30506: 30506.patch

File 30506.patch, 5.5 KB (added by SergeyBiryukov, 8 years ago)
  • src/wp-admin/includes/template.php

     
    725725        $year = '<label><span class="screen-reader-text">' . __( 'Year' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    726726        $hour = '<label><span class="screen-reader-text">' . __( 'Hour' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
    727727        $minute = '<label><span class="screen-reader-text">' . __( 'Minute' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
     728        /* translators: 1: hour, 2: minute */
     729        $time = '<span dir="ltr">' . sprintf( __( '%1$s:%2$s' ), $hour, $minute ) . '</span>';
    728730
    729731        echo '<div class="timestamp-wrap">';
    730         /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    731         printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
     732        /* translators: 1: month, 2: day, 3: year, 4: time */
     733        printf( __( '%1$s %2$s, %3$s @ %4$s' ), $month, $day, $year, $time );
    732734
    733735        echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    734736
  • src/wp-admin/js/comment.js

     
    3434
    3535        $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
    3636                var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
    37                         newD = new Date( aa, mm - 1, jj, hh, mn );
     37                        newD = new Date( aa, mm - 1, jj, hh, mn ),
     38                        commentTime;
    3839
    3940                event.preventDefault();
    4041
     
    4546                        $timestampwrap.removeClass( 'form-invalid' );
    4647                }
    4748
     49                commentTime = commentL10n.timeFormat
     50                        .replace( '%1$s', ( '00' + hh ).slice( -2 ) )
     51                        .replace( '%2$s', ( '00' + mn ).slice( -2 ) );
     52
    4853                $timestamp.html(
    4954                        commentL10n.submittedOn + ' <b>' +
    5055                        commentL10n.dateFormat
     
    5156                                .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
    5257                                .replace( '%2$s', parseInt( jj, 10 ) )
    5358                                .replace( '%3$s', aa )
    54                                 .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
    55                                 .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
     59                                .replace( '%4$s', commentTime ) +
    5660                                '</b> '
    5761                );
    5862
  • src/wp-admin/js/post.js

     
    720720
    721721                        var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
    722722                                optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
    723                                 mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
     723                                mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
     724                                publishTime;
    724725
    725726                        attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
    726727                        originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() );
     
    751752                                // Re-set to the current value.
    752753                                $('#timestamp').html(stamp);
    753754                        } else {
     755                                publishTime = postL10n.timeFormat
     756                                                .replace( '%1$s', ( '00' + hh ).slice( -2 ) )
     757                                                .replace( '%2$s', ( '00' + mn ).slice( -2 ) );
     758
    754759                                $('#timestamp').html(
    755760                                        '\n' + publishOn + ' <b>' +
    756761                                        postL10n.dateFormat
     
    757762                                                .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
    758763                                                .replace( '%2$s', parseInt( jj, 10 ) )
    759764                                                .replace( '%3$s', aa )
    760                                                 .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
    761                                                 .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
     765                                                .replace( '%4$s', publishTime ) +
    762766                                                '</b> '
    763767                                );
    764768                        }
  • src/wp-includes/script-loader.php

     
    556556                        'publishOn' => __('Publish on:'),
    557557                        'publishOnFuture' =>  __('Schedule for:'),
    558558                        'publishOnPast' => __('Published on:'),
    559                         /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    560                         'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s'),
     559                        /* translators: 1: month, 2: day, 3: year, 4: time */
     560                        'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s' ),
     561                        /* translators: 1: hour, 2: minute */
     562                        'timeFormat' => __( '%1$s:%2$s' ),
    561563                        'showcomm' => __('Show more comments'),
    562564                        'endcomm' => __('No more comments found.'),
    563565                        'publish' => __('Publish'),
     
    595597                $scripts->add_data( 'comment', 'group', 1 );
    596598                did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array(
    597599                        'submittedOn' => __( 'Submitted on:' ),
    598                         /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    599                         'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' )
     600                        /* translators: 1: month, 2: day, 3: year, 4: time */
     601                        'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s' ),
     602                        /* translators: 1: hour, 2: minute */
     603                        'timeFormat' => __( '%1$s:%2$s' ),
    600604                ) );
    601605
    602606                $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );