WordPress.org

Make WordPress Core

Ticket #13444: 13444_2.diff

File 13444_2.diff, 4.4 KB (added by michaelh, 4 years ago)

correct strings for post_type in wp-admin/edit-form-advanced.php

  • wp-admin/edit-form-advanced.php

     
    3636$messages = array(); 
    3737$messages['post'] = array( 
    3838        '', 
    39         sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ), 
     39        sprintf( __('%s updated. <a href="%s">View %s</a>'), $post_type_object->labels->singular_name, esc_url( get_permalink($post_ID) ), $post_type ), 
    4040        __('Custom field updated.'), 
    4141        __('Custom field deleted.'), 
    42         __('Post updated.'), 
     42        sprintf(__('%s updated.'), $post_type_object->labels->singular_name ), 
    4343        /* translators: %s: date and time of the revision */ 
    44         isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 
    45         sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ), 
    46         __('Post saved.'), 
    47         sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 
    48         sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'), 
     44        isset($_GET['revision']) ? sprintf( __('%s restored to revision from %s'), $post_type_object->labels->singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 
     45        sprintf( __('%s published. <a href="%s">View %s</a>'), $post_type_object->labels->singular_name, esc_url( get_permalink($post_ID) ), $post_type ), 
     46        sprintf(__('%s saved.'), $post_type_object->labels->singular_name ), 
     47        sprintf( __('%s submitted. <a target="_blank" href="%s">Preview %s</a>'), $post_type_object->labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ), $post_type ), 
     48        sprintf( __('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>'), $post_type_object->labels->singular_name, 
    4949                // translators: Publish box date format, see http://php.net/date 
    50                 date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ), 
    51         sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 
     50                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ), $post_type ), 
     51        sprintf( __('%s draft updated. <a target="_blank" href="%s">Preview %s</a>'), $post_type_object->labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ), $post_type), 
    5252); 
    53 $messages['page'] = array( 
    54         '', 
    55         sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ), 
    56         __('Custom field updated.'), 
    57         __('Custom field deleted.'), 
    58         __('Page updated.'), 
    59         isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 
    60         sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ), 
    61         __('Page saved.'), 
    62         sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 
    63         sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ), 
    64         sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 
    65 ); 
     53$messages['page'] = $messages['post']; 
    6654 
    6755$message = false; 
    6856if ( isset($_GET['message']) ) { 
     
    9280if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { 
    9381        foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 
    9482                if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { 
    95                         $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below.  <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) ); 
     83                        $notice = sprintf( __( 'There is an autosave of this %s that is more recent than the version below.  <a href="%s">View the autosave</a>' ), $post_type, get_edit_post_link( $autosave->ID ) ); 
    9684                        break; 
    9785                } 
    9886        }