Make WordPress Core

Ticket #64986: 64986.diff

File 64986.diff, 2.5 KB (added by motylanogha, 8 weeks ago)

Refreshed patch for current trunk. Adds translator context to all 4 instances of ( 'Preview' ) using _x() with descriptive context strings.

  • src/wp-admin/includes/class-wp-posts-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php
    index c7d10fca21..61a31a6bc4 100644
    a b class WP_Posts_List_Table extends WP_List_Table { 
    15891589                                                esc_url( $preview_link ),
    15901590                                                /* translators: %s: Post title. */
    15911591                                                esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ),
    1592                                                 __( 'Preview' )
     1592                                                _x( 'Preview', 'post action' )
    15931593                                        );
    15941594                                }
    15951595                        } elseif ( 'trash' !== $post->post_status ) {
  • src/wp-admin/includes/class-wp-theme-install-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-theme-install-list-table.php b/src/wp-admin/includes/class-wp-theme-install-list-table.php
    index 696b088d1d..836f5f7254 100644
    a b class WP_Theme_Install_List_Table extends WP_Themes_List_Table { 
    345345                        '<a class="install-theme-preview" href="%s" aria-label="%s">%s</a>',
    346346                        esc_url( $preview_url ),
    347347                        esc_attr( $preview_title ),
    348                         __( 'Preview' )
     348                        _x( 'Preview', 'theme action' )
    349349                );
    350350
    351351                /**
  • src/wp-admin/includes/meta-boxes.php

    diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php
    index 0884c110b6..54c98c0eae 100644
    a b function post_submit_meta_box( $post, $args = array() ) { 
    7070                                if ( 'publish' === $post->post_status ) {
    7171                                        $preview_button_text = __( 'Preview Changes' );
    7272                                } else {
    73                                         $preview_button_text = __( 'Preview' );
     73                                        $preview_button_text = _x( 'Preview', 'button' );
    7474                                }
    7575
    7676                                $preview_button = sprintf(
  • src/wp-includes/class-wp-editor.php

    diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php
    index 7ddd60fe87..b73016c9a9 100644
    a b final class _WP_Editors { 
    12521252                                'Nonbreaking space'                    => __( 'Nonbreaking space' ),
    12531253                                'Page break'                           => __( 'Page break' ),
    12541254                                'Paste as text'                        => __( 'Paste as text' ),
    1255                                 'Preview'                              => __( 'Preview' ),
     1255                                'Preview'                              => _x( 'Preview', 'editor button' ),
    12561256                                'Print'                                => __( 'Print' ),
    12571257                                'Save'                                 => __( 'Save' ),
    12581258                                'Fullscreen'                           => __( 'Fullscreen' ),