Coding Standards: Add missing translator comments to the default themes.

All default themes now have translator comments for all strings with placeholders!

See #46732.

Built from https://develop.svn.wordpress.org/trunk@45609


git-svn-id: http://core.svn.wordpress.org/trunk@45420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-07-09 01:10:00 +00:00
parent 1eee82c903
commit e23ae9ea87
14 changed files with 84 additions and 23 deletions

View File

@ -26,16 +26,19 @@ get_header(); ?>
<header class="archive-header">
<h1 class="archive-title">
<?php
if ( is_day() ) :
if ( is_day() ) {
/* translators: %s: date */
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( is_year() ) :
printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
else :
_e( 'Archives', 'twentytwelve' );
endif;
?>
} elseif ( is_month() ) {
/* translators: %s: date */
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
} elseif ( is_year() ) {
/* translators: %s: date */
printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
} else {
_e( 'Archives', 'twentytwelve' );
}
?>
</h1>
</header><!-- .archive-header -->

View File

@ -29,7 +29,12 @@ get_header(); ?>
?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Author Archives: %s', 'twentytwelve' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
<h1 class="archive-title">
<?php
/* translators: author display name */
printf( __( 'Author Archives: %s', 'twentytwelve' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' );
?>
</h1>
</header><!-- .archive-header -->
<?php
@ -61,7 +66,12 @@ get_header(); ?>
?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<h2>
<?php
/* translators: author display name */
printf( __( 'About %s', 'twentytwelve' ), get_the_author() );
?>
</h2>
<p><?php the_author_meta( 'description' ); ?></p>
</div><!-- .author-description -->
</div><!-- .author-info -->

View File

@ -18,7 +18,12 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
<h1 class="archive-title">
<?php
/* translators: %s: category title */
printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?>
</h1>
<?php if ( category_description() ) : // Show an optional category description ?>
<div class="archive-meta"><?php echo category_description(); ?></div>

View File

@ -6,6 +6,9 @@
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/* translators: %s: post title */
$post_title = sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@ -17,7 +20,7 @@
</div><!-- .aside -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( $post_title ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>

View File

@ -6,6 +6,9 @@
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/* translators: %s: post title */
$post_title = sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@ -15,7 +18,7 @@
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( $post_title ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>

View File

@ -6,6 +6,9 @@
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/* translators: %s: post title */
$post_title = sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
@ -14,7 +17,7 @@
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( $post_title ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>

View File

@ -6,13 +6,16 @@
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/* translators: %s: post title */
$post_title = sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-header">
<header>
<h1><?php the_author(); ?></h1>
<h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a></h2>
<h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( $post_title ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a></h2>
</header>
<?php
/**

View File

@ -68,11 +68,19 @@
?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<h2>
<?php
/* translators: %s: author display name */
printf( __( 'About %s', 'twentytwelve' ), get_the_author() );
?>
</h2>
<p><?php the_author_meta( 'description' ); ?></p>
<div class="author-link">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
<?php
/* translators: %s: author display name */
printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() );
?>
</a>
</div><!-- .author-link -->
</div><!-- .author-description -->

View File

@ -19,7 +19,10 @@
}
?>
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentytwelve' ) ); ?>" class="imprint" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>">
<?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?>
<?php
/* translators: %s: WordPress */
printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' );
?>
</a>
</div><!-- .site-info -->
</footer><!-- #colophon -->

View File

@ -308,6 +308,7 @@ function twentytwelve_wp_title( $title, $sep ) {
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
/* translators: %s: page number */
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
}
@ -502,16 +503,19 @@ if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
$author = sprintf(
'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
/* translators: %s: author display name */
esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
get_the_author()
);
// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
if ( $tag_list ) {
/* translators: 1: category name, 2: tag name, 3: date, 4: author display name */
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} elseif ( $categories_list ) {
/* translators: 1: category name, 3: date, 4: author display name */
$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} else {
/* translators: 3: date, 4: author display name */
$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
}

View File

@ -27,6 +27,7 @@ get_header(); ?>
<?php
$metadata = wp_get_attachment_metadata();
printf(
/* translators: 1: date, 2: date, 3: attachment URL, 4: image width in pixels, 5: image height in pixels, 6: post parent permalink, 7: post parent title, 8: post parent title */
__( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),

View File

@ -43,7 +43,12 @@ get_header(); ?>
</header>
<div class="entry-content">
<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
<p>
<?php
/* translators: %s: post editor URL */
printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) );
?>
</p>
</div><!-- .entry-content -->
<?php

View File

@ -15,7 +15,12 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentytwelve' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<h1 class="page-title">
<?php
/* translators: %s: search query */
printf( __( 'Search Results for: %s', 'twentytwelve' ), '<span>' . get_search_query() . '</span>' );
?>
</h1>
</header>
<?php twentytwelve_content_nav( 'nav-above' ); ?>

View File

@ -18,7 +18,12 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?></h1>
<h1 class="archive-title">
<?php
/* translators: %s: tag title */
printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' );
?>
</h1>
<?php if ( tag_description() ) : // Show an optional tag description ?>
<div class="archive-meta"><?php echo tag_description(); ?></div>