Skip to content

Commit 4f7d6c8

Browse files
committed
I18N: Add translator context to disambiguate translation strings for "Preview".
This changeset disambiguates translation strings for "Preview" by adding a verb|noun context to its occurrences. Props timse201, audrasjb, anupkankale, mohamedahamed, rafaeldella, motylanogha, wildworks, jorbin, khokansardar, sergeybiryukov. Fixes #64986. git-svn-id: https://develop.svn.wordpress.org/trunk@62353 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2ac3075 commit 4f7d6c8

10 files changed

Lines changed: 14 additions & 14 deletions

src/wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
<span class="spinner"></span>
211211
<button type="button" class="customize-controls-preview-toggle">
212212
<span class="controls"><?php _e( 'Customize' ); ?></span>
213-
<span class="preview"><?php _e( 'Preview' ); ?></span>
213+
<span class="preview"><?php echo esc_html_x( 'Preview', 'noun' ); ?></span>
214214
</button>
215215
<a class="customize-controls-close" href="<?php echo esc_url( $wp_customize->get_return_url() ); ?>">
216216
<span class="screen-reader-text">

src/wp-admin/includes/class-custom-background.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function admin_page() {
279279
<table class="form-table" role="presentation">
280280
<tbody>
281281
<tr>
282-
<th scope="row"><?php _e( 'Preview' ); ?></th>
282+
<th scope="row"><?php echo esc_html_x( 'Preview', 'noun' ); ?></th>
283283
<td>
284284
<?php
285285
if ( $this->admin_image_div_callback ) {

src/wp-admin/includes/class-custom-image-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ public function step_1() {
550550

551551
<?php if ( get_custom_header() || display_header_text() ) : ?>
552552
<tr>
553-
<th scope="row"><?php _e( 'Preview' ); ?></th>
553+
<th scope="row"><?php echo esc_html_x( 'Preview', 'noun' ); ?></th>
554554
<td>
555555
<?php
556556
if ( $this->admin_image_div_callback ) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
15481548
esc_url( $preview_link ),
15491549
/* translators: %s: Post title. */
15501550
esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ),
1551-
__( 'Preview' )
1551+
_x( 'Preview', 'verb' )
15521552
);
15531553
}
15541554
} elseif ( 'trash' !== $post->post_status ) {

src/wp-admin/includes/class-wp-theme-install-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function single_row( $theme ) {
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', 'verb' )
349349
);
350350

351351
/**

src/wp-admin/includes/meta-boxes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ 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', 'verb' );
7474
}
7575

7676
$preview_button = sprintf(

src/wp-admin/includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ function _admin_notice_post_locked() {
19001900
<p>
19011901
<a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
19021902
<?php if ( $preview_link ) { ?>
1903-
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
1903+
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php echo esc_html_x( 'Preview', 'verb' ); ?></a>
19041904
<?php
19051905
}
19061906

src/wp-admin/theme-install.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
423423
<# } #>
424424
<# } else { #>
425-
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
425+
<button class="button preview install-theme-preview"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
426426
<# } #>
427427
<# } else { #>
428428
<?php
@@ -435,7 +435,7 @@
435435
<# if ( data.customize_url ) { #>
436436
<a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
437437
<# } else { #>
438-
<button class="button disabled"><?php _e( 'Preview' ); ?></button>
438+
<button class="button disabled"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
439439
<# } #>
440440
<# } #>
441441
<# } else { #>
@@ -445,14 +445,14 @@
445445
$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
446446
?>
447447
<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
448-
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
448+
<button class="button preview install-theme-preview"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
449449
<# } else { #>
450450
<?php
451451
/* translators: %s: Theme name. */
452452
$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
453453
?>
454454
<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
455-
<button class="button disabled"><?php _e( 'Preview' ); ?></button>
455+
<button class="button disabled"><?php echo esc_html_x( 'Preview', 'verb' ); ?></button>
456456
<# } #>
457457
<# } #>
458458
</div>
@@ -605,7 +605,7 @@
605605
</div>
606606
</div>
607607
<div class="wp-full-overlay-main">
608-
<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
608+
<iframe src="{{ data.preview_url }}" title="<?php echo esc_attr_x( 'Preview', 'noun' ); ?>"></iframe>
609609
</div>
610610
</script>
611611

src/wp-includes/class-wp-customize-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4333,7 +4333,7 @@ public function render_control_templates() {
43334333
<# if ( data.returnUrl !== data.previewUrl ) { #>
43344334
<a class="button customize-notice-go-back-button" href="{{ data.returnUrl }}"><?php _e( 'Go back' ); ?></a>
43354335
<# } #>
4336-
<a class="button customize-notice-preview-button" href="{{ data.frontendPreviewUrl }}"><?php _e( 'Preview' ); ?></a>
4336+
<a class="button customize-notice-preview-button" href="{{ data.frontendPreviewUrl }}"><?php echo esc_html_x( 'Preview', 'verb' ); ?></a>
43374337
<# if ( data.allowOverride ) { #>
43384338
<button class="button button-primary wp-tab-last customize-notice-take-over-button"><?php _e( 'Take over' ); ?></button>
43394339
<# } #>

src/wp-includes/class-wp-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ private static function get_translation() {
12521252
'Nonbreaking space' => __( 'Nonbreaking space' ),
12531253
'Page break' => __( 'Page break' ),
12541254
'Paste as text' => __( 'Paste as text' ),
1255-
'Preview' => __( 'Preview' ),
1255+
'Preview' => _x( 'Preview', 'verb' ),
12561256
'Print' => __( 'Print' ),
12571257
'Save' => __( 'Save' ),
12581258
'Fullscreen' => __( 'Fullscreen' ),

0 commit comments

Comments
 (0)