Skip to content

Commit

Permalink
Block Directory: Remove the author rating when none exist (#22184)
Browse files Browse the repository at this point in the history
A `0` rating means there have been no reviews submitted, so we can omit this string.
  • Loading branch information
ryelle authored May 12, 2020
1 parent 3616a16 commit 8676302
Showing 1 changed file with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ function DownloadableBlockAuthorInfo( {
) }
</span>
<span className="block-directory-downloadable-block-author-info__content">
{ sprintf(
/* translators: 1: number of blocks. 2: average rating. */
_n(
'This author has %1$d block, with an average rating of %2$d.',
'This author has %1$d blocks, with an average rating of %2$d.',
authorBlockCount
),
authorBlockCount,
authorBlockRating
) }
{ authorBlockRating > 0
? sprintf(
/* translators: 1: number of blocks. 2: average rating. */
_n(
'This author has %1$d block, with an average rating of %2$d.',
'This author has %1$d blocks, with an average rating of %2$d.',
authorBlockCount
),
authorBlockCount,
authorBlockRating
)
: sprintf(
/* translators: 1: number of blocks. */
_n(
'This author has %1$d block.',
'This author has %1$d blocks.',
authorBlockCount
),
authorBlockCount
) }
</span>
</Fragment>
);
Expand Down

0 comments on commit 8676302

Please sign in to comment.