Skip to content

Commit 06a21af

Browse files
authored
Properly format review count numbers with respect to their locale. (#707)
1 parent 1443995 commit 06a21af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mu-plugins/blocks/ratings-bars/render.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
<a href="<?php echo esc_url( $support_url ); ?>">
5454
<span class="screen-reader-text">
5555
<?php
56-
// translators: %1$d: count of reviews. %2$d: level of star rating (ex, 5-star).
57-
echo esc_html( sprintf( _n( '%1$d %2$d-star review', '%1$d %2$d-star reviews', $count, 'wporg' ), $count, $stars ) );
56+
// translators: %1$s: count of reviews. %2$d: level of star rating (ex, 5-star).
57+
echo esc_html( sprintf( _n( '%1$s %2$d-star review', '%1$s %2$d-star reviews', $count, 'wporg' ), number_format_i18n( $count ), $stars ) );
5858
?>
5959
</span>
6060
<span aria-hidden="true" class="wporg-ratings-bars__bar-label">
@@ -66,7 +66,7 @@
6666
<span aria-hidden="true" class="wporg-ratings-bars__bar-background">
6767
<span class="wporg-ratings-bars__bar-foreground" style="width: <?php echo intval( $rating_bar_width ); ?>%;"></span>
6868
</span>
69-
<span aria-hidden="true" class="wporg-ratings-bars__bar-count"><?php echo intval( $count ); ?></span>
69+
<span aria-hidden="true" class="wporg-ratings-bars__bar-count"><?php echo number_format_i18n( $count ); ?></span>
7070
</a>
7171
</li>
7272
<?php endforeach; ?>

0 commit comments

Comments
 (0)