Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Added footer translator comment #237

Merged
merged 17 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ script:
# -n flag: Do not print warnings (shortcut for --warning-severity=0)
# --standard: Use WordPress as the standard.
# --extensions: Only sniff PHP files.
- if [ -e $WP_DEVELOP_DIR/phpcs.phar ]; then php $WP_DEVELOP_DIR/phpcs.phar -p -s -v -n . --extensions=php; fi
- if [ -e $WP_DEVELOP_DIR/phpcs.phar ]; then php $WP_DEVELOP_DIR/phpcs.phar -p -s -v -n . --extensions=php; fi
12 changes: 6 additions & 6 deletions classes/class-twentynineteen-walker-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ protected function html5_comment( $comment, $depth, $args ) {
$comment_author_link = get_comment_author_link( $comment );
$comment_author_url = get_comment_author_url( $comment );
$avatar = get_avatar( $comment, $args['avatar_size'] );
if ( 0 != $args['avatar_size'] ) {
if ( empty( $comment_author_url ) ) {
if ( 0 != $args['avatar_size'] ) {
if ( empty( $comment_author_url ) ) {
echo $avatar;
} else {
} else {
echo preg_replace( '/>[^<]+</', sprintf( '>%s<', $avatar ), $comment_author_link );
}
}
}

/*
* Using the `check` icon instead of `check_circle`, since we can't add a
* fill color to the inner check shape when in circle form.
*/
if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
/* translators: %s: SVG Icon */
printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
}
}

/* translators: %s: comment author link */
printf(
Expand Down
20 changes: 10 additions & 10 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
<div class="<?php echo twentynineteen_get_discussion_data()->responses > 0 ? 'comments-title-wrap' : 'comments-title-wrap no-responses'; ?>">
<h2 class="comments-title">
<?php
if ( comments_open() ) {
if ( have_comments() ) {
if ( comments_open() ) {
if ( have_comments() ) {
esc_html_e( 'Join the Conversation', 'twentynineteen' );
} else {
esc_html_e( 'Leave a comment', 'twentynineteen' );
}
} else {
esc_html_e( 'Leave a comment', 'twentynineteen' );
}
} else {
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
if ( '1' === $comments_number ) {
/* translators: %s: post title */
printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentynineteen' ), get_the_title() );
} else {
} else {
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
Expand All @@ -51,15 +51,15 @@
number_format_i18n( $comments_number ),
get_the_title()
);
}
}
}
?>
</h2><!-- .comments-title -->
<?php
// Only show discussion meta information when comments are open and available.
if ( have_comments() && comments_open() ) {
if ( have_comments() && comments_open() ) {
get_template_part( 'template-parts/post/discussion', 'meta' );
}
}
?>
</div><!-- .comments-title-flex -->
<?php
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="site-info">
<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>,
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>" class="imprint">
<?php printf( __( 'Proudly powered by %s', 'twentynineteen' ), 'WordPress' ); ?>.
<?php esc_html_e( 'Proudly powered by WordPress', 'twentynineteen' ); ?>
</a>
<?php
if ( function_exists( 'the_privacy_policy_link' ) ) {
Expand Down
4 changes: 2 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<?php the_post(); ?>
<div class="entry-header">
<?php if ( ! is_page() ) : ?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
<?php endif; ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php if ( ! is_page() ) : ?>
Expand All @@ -43,7 +43,7 @@
<span class="comment-count">
<?php
if ( ! empty( $discussion ) ) {
twentynineteen_discussion_avatars_list( $discussion->authors );}
twentynineteen_discussion_avatars_list( $discussion->authors );}
?>
<?php twentynineteen_comment_count(); ?>
</span>
Expand Down
1 change: 0 additions & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function twentynineteen_posted_on() {
function twentynineteen_posted_by() {
printf(
'<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
twentynineteen_get_icon_svg( 'person', 16 ),
esc_html__( 'Posted by', 'twentynineteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
Expand Down
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
<main id="main" class="site-main">

<?php
if ( have_posts() ) {
if ( have_posts() ) {

// Load posts loop.
while ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content/content' );
}
}

// Previous/next page navigation.
twentynineteen_the_posts_navigation();

} else {
} else {

// If no content, include the "No posts found" template.
get_template_part( 'template-parts/content/content', 'none' );

}
}
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
Expand Down
2 changes: 1 addition & 1 deletion template-parts/content/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<header class="entry-header">
<?php
if ( ! twentynineteen_can_show_post_thumbnail() ) {
get_template_part( 'template-parts/header/entry', 'header' );}
get_template_part( 'template-parts/header/entry', 'header' );}
?>
</header>

Expand Down
4 changes: 2 additions & 2 deletions template-parts/content/content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?php if ( ! twentynineteen_can_show_post_thumbnail() ) : ?>
<header class="entry-header">
<?php if ( ! is_page() ) : ?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
<?php endif; ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php if ( ! is_page() ) : ?>
Expand All @@ -25,7 +25,7 @@
<span class="comment-count">
<?php
if ( ! empty( $discussion ) ) {
twentynineteen_discussion_avatars_list( $discussion->authors );}
twentynineteen_discussion_avatars_list( $discussion->authors );}
?>
<?php twentynineteen_comment_count(); ?>
</span>
Expand Down
6 changes: 3 additions & 3 deletions template-parts/header/entry-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/

if ( ! is_page() ) :
?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
?>
<?php $discussion = twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; ?>
<?php endif; ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php if ( ! is_page() ) : ?>
Expand All @@ -19,7 +19,7 @@
<span class="comment-count">
<?php
if ( ! empty( $discussion ) ) {
twentynineteen_discussion_avatars_list( $discussion->authors );}
twentynineteen_discussion_avatars_list( $discussion->authors );}
?>
<?php twentynineteen_comment_count(); ?>
</span>
Expand Down
10 changes: 9 additions & 1 deletion template-parts/post/author-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
if ( (bool) get_the_author_meta( 'description' ) ) : ?>
<div class="author-description">
<h2 class="author-title">
<span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
<span class="author-heading">
<?php
printf(
/* translators: %s: post author */
__( 'Published by %s', 'twentynineteen' ),
esc_html( get_the_author() )
);
?>
</span>
</h2>
<p class="author-bio">
<?php the_author_meta( 'description' ); ?>
Expand Down
3 changes: 3 additions & 0 deletions template-parts/post/discussion-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
/* translators: %1(X responses)$s from %2(X others)$s */
$meta_label = sprintf(
'%1$s from %2$s.',
/* translators: %d(X responses)$s */
sprintf( _n( '%d response', '%d responses', $discussion->responses, 'twentynineteen' ), $discussion->responses ),
/* translators: %d(X others)$s */
sprintf( _n( '%d other', '%d others', $discussion->commenters, 'twentynineteen' ), $discussion->commenters )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #218.

);
} elseif ( $comments_number > 0 ) {
/* Show comment count if not enough discussion information */

/* translators: %d: number of comments */
$meta_label = sprintf( _n( '%d Comment', '%d Comments', $comments_number, 'twentynineteen' ), $comments_number );
} else {
$meta_label = __( 'No comments', 'twentynineteen' );
Expand Down