Skip to content

Commit

Permalink
fix: string translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Oct 7, 2024
1 parent e6e9843 commit 8990a37
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
9 changes: 7 additions & 2 deletions inc/class-blocks-animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ public function render_welcome_notice() {
$notice_html .= '<div class="notice-copy">';

$notice_html .= '<h1 class="notice-title">';
/* translators: %s: Otter Blocks */
$notice_html .= sprintf( __( 'Power Up Your Site with %1$s, %2$s, %3$s, and more!', 'otter-blocks' ), '<span>Add-on Blocks</span>', '<span>Enhanced Animations</span>', '<span>Visibility Conditions</span>' );
$notice_html .= sprintf(
/* translators: %1$s: Add-on Blocks, %2$s: Enhanced Animations, %3$s: Visibility Conditions */
__( 'Power Up Your Site with %1$s, %2$s, %3$s, and more!', 'otter-blocks' ),
'<span>' . __( 'Add-on Blocks', 'otter-blocks' ) . '</span>',
'<span>' . __( 'Enhanced Animations', 'otter-blocks' ) . '</span>',
'<span>' . __( 'Visibility Conditions', 'otter-blocks' ) . '</span>'
);

$notice_html .= '</h1>';

Expand Down
17 changes: 12 additions & 5 deletions inc/render/class-review-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ function() use ( $attributes, $post_id ) {
$html .= ' <div class="o-review__header_ratings__stars">';
$html .= $this->get_overall_stars( $this->get_overall_ratings( $attributes['features'] ), $scale );
$html .= ' </div>';
// translators: Overall rating from 1 to 10.
$html .= ' <span>' . sprintf( __( '%1$g out of %2$g', 'otter-blocks' ), $this->get_overall_ratings( $attributes['features'], $scale ), 10 / $scale ) . '</span>';
$html .= ' <span>' . sprintf(
// translators: %1$g is the overall rating, %2$g is the maximum rating.
__( '%1$g out of %2$g', 'otter-blocks' ),
$this->get_overall_ratings( $attributes['features'], $scale ),
10 / $scale
) . '</span>';
$html .= ' </div>';

if ( ( isset( $attributes['price'] ) && ! empty( $attributes['price'] ) ) || isset( $attributes['discounted'] ) ) {
Expand Down Expand Up @@ -133,9 +137,12 @@ function() use ( $attributes, $post_id ) {
$html .= ' <div class="o-review__left_feature_ratings__stars">';
$html .= $this->get_overall_stars( $feature['rating'], $scale );
$html .= ' </div>';

// translators: Overall rating from 1 to 10.
$html .= ' <span class="o-review__left_feature_num">' . sprintf( __( '%1$g out of %2$g', 'otter-blocks' ), 1 <= round( $feature['rating'] / $scale, 1 ) ? round( $feature['rating'] / $scale, 1 ) : 1, 10 / $scale ) . '</span>';
$html .= ' <span class="o-review__left_feature_num">' . sprintf(
// translators: %1$g is the overall rating, %2$g is the maximum rating.
__( '%1$g out of %2$g', 'otter-blocks' ),
1 <= round( $feature['rating'] / $scale, 1 ) ? round( $feature['rating'] / $scale, 1 ) : 1,
10 / $scale
) . '</span>';

$html .= ' </div>';

Expand Down

0 comments on commit 8990a37

Please sign in to comment.