Skip to content

Commit 9fedd3c

Browse files
committed
Bundled Themes: Place translator comments directly before their strings.
Some translator comments were placed in front of a ternary operator or shared a line with several translatable strings. String extraction tools either miss such comments or attach them to the wrong string. This moves each comment directly before the gettext call it describes. This is the bundled themes counterpart of r65774, which fixes the same problem in core. Developed in: #16071 Props swissspidy, mukesh27. See #66747. git-svn-id: https://develop.svn.wordpress.org/trunk@65775 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 967cbe9 commit 9fedd3c

7 files changed

Lines changed: 71 additions & 26 deletions

File tree

‎src/wp-content/themes/twentyeleven/archive.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@
2626
/* translators: %s: Date. */
2727
printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' );
2828
} elseif ( is_month() ) {
29-
/* translators: %s: Date. */
30-
printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>' );
29+
printf(
30+
/* translators: %s: Date. */
31+
__( 'Monthly Archives: %s', 'twentyeleven' ),
32+
'<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>'
33+
);
3134
} elseif ( is_year() ) {
32-
/* translators: %s: Date. */
33-
printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>' );
35+
printf(
36+
/* translators: %s: Date. */
37+
__( 'Yearly Archives: %s', 'twentyeleven' ),
38+
'<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>'
39+
);
3440
} else {
3541
_e( 'Blog Archives', 'twentyeleven' );
3642
}

‎src/wp-content/themes/twentyfourteen/archive.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@
3131
/* translators: %s: Date. */
3232
printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() );
3333
} elseif ( is_month() ) {
34-
/* translators: %s: Date. */
35-
printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) );
34+
printf(
35+
/* translators: %s: Date. */
36+
__( 'Monthly Archives: %s', 'twentyfourteen' ),
37+
get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) )
38+
);
3639
} elseif ( is_year() ) {
37-
/* translators: %s: Date. */
38-
printf( __( 'Yearly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfourteen' ) ) );
40+
printf(
41+
/* translators: %s: Date. */
42+
__( 'Yearly Archives: %s', 'twentyfourteen' ),
43+
get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfourteen' ) )
44+
);
3945
} else {
4046
_e( 'Archives', 'twentyfourteen' );
4147
}

‎src/wp-content/themes/twentyfourteen/inc/customizer.php‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,13 @@ function twentyfourteen_contextual_help() {
164164
'title' => __( 'Twenty Fourteen', 'twentyfourteen' ),
165165
'content' =>
166166
'<ul>' .
167-
/* translators: 1: Featured tag editor URL, 2: Post editor URL, 3: Customizer URL, 4: Post editor URL. */
168-
'<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' .
167+
'<li>' . sprintf(
168+
/* translators: 1: Featured tag editor URL, 2: Post editor URL, 3: Customizer URL, 4: Post editor URL. */
169+
__( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ),
170+
esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ),
171+
admin_url( 'customize.php' ),
172+
admin_url( 'edit.php?show_sticky=1' )
173+
) . '</li>' .
169174
/* translators: %s: Featured images documentation URL. */
170175
'<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' .
171176
/* translators: %s: Twenty Fourteen documentation URL. */

‎src/wp-content/themes/twentyseventeen/single.php‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,20 @@
3030

3131
the_post_navigation(
3232
array(
33-
/* translators: Hidden accessibility text. */
34-
'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>',
35-
/* translators: Hidden accessibility text. */
36-
'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>',
33+
'prev_text' => '<span class="screen-reader-text">' .
34+
/* translators: Hidden accessibility text. */
35+
__( 'Previous Post', 'twentyseventeen' ) .
36+
'</span><span aria-hidden="true" class="nav-subtitle">' .
37+
/* translators: Visible label for the link to the previous post. */
38+
__( 'Previous', 'twentyseventeen' ) .
39+
'</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>',
40+
'next_text' => '<span class="screen-reader-text">' .
41+
/* translators: Hidden accessibility text. */
42+
__( 'Next Post', 'twentyseventeen' ) .
43+
'</span><span aria-hidden="true" class="nav-subtitle">' .
44+
/* translators: Visible label for the link to the next post. */
45+
__( 'Next', 'twentyseventeen' ) .
46+
'</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>',
3747
)
3848
);
3949

‎src/wp-content/themes/twentyten/archive.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@
3636
/* translators: %s: Date. */
3737
printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() );
3838
} elseif ( is_month() ) {
39-
/* translators: %s: Date. */
40-
printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) );
39+
printf(
40+
/* translators: %s: Date. */
41+
__( 'Monthly Archives: <span>%s</span>', 'twentyten' ),
42+
get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) )
43+
);
4144
} elseif ( is_year() ) {
42-
/* translators: %s: Date. */
43-
printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) );
45+
printf(
46+
/* translators: %s: Date. */
47+
__( 'Yearly Archives: <span>%s</span>', 'twentyten' ),
48+
get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) )
49+
);
4450
} else {
4551
_e( 'Blog Archives', 'twentyten' );
4652
}

‎src/wp-content/themes/twentythirteen/archive.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@
3030
/* translators: %s: Date. */
3131
printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() );
3232
} elseif ( is_month() ) {
33-
/* translators: %s: Date. */
34-
printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) );
33+
printf(
34+
/* translators: %s: Date. */
35+
__( 'Monthly Archives: %s', 'twentythirteen' ),
36+
get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) )
37+
);
3538
} elseif ( is_year() ) {
36-
/* translators: %s: Date. */
37-
printf( __( 'Yearly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) ) );
39+
printf(
40+
/* translators: %s: Date. */
41+
__( 'Yearly Archives: %s', 'twentythirteen' ),
42+
get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) )
43+
);
3844
} else {
3945
_e( 'Archives', 'twentythirteen' );
4046
}

‎src/wp-content/themes/twentytwelve/archive.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@
3030
/* translators: %s: Date. */
3131
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
3232
} elseif ( is_month() ) {
33-
/* translators: %s: Date. */
34-
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
33+
printf(
34+
/* translators: %s: Date. */
35+
__( 'Monthly Archives: %s', 'twentytwelve' ),
36+
'<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>'
37+
);
3538
} elseif ( is_year() ) {
36-
/* translators: %s: Date. */
37-
printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
39+
printf(
40+
/* translators: %s: Date. */
41+
__( 'Yearly Archives: %s', 'twentytwelve' ),
42+
'<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>'
43+
);
3844
} else {
3945
_e( 'Archives', 'twentytwelve' );
4046
}

0 commit comments

Comments
 (0)