From 8990a37d13335eb8d2f2b1b2645c9e7bbc6b39aa Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Mon, 7 Oct 2024 17:07:31 +0300 Subject: [PATCH] fix: string translation --- inc/class-blocks-animation.php | 9 +++++++-- inc/render/class-review-block.php | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/inc/class-blocks-animation.php b/inc/class-blocks-animation.php index 9efb7b298..1920aca11 100644 --- a/inc/class-blocks-animation.php +++ b/inc/class-blocks-animation.php @@ -287,8 +287,13 @@ public function render_welcome_notice() { $notice_html .= '
'; $notice_html .= '

'; - /* translators: %s: Otter Blocks */ - $notice_html .= sprintf( __( 'Power Up Your Site with %1$s, %2$s, %3$s, and more!', 'otter-blocks' ), 'Add-on Blocks', 'Enhanced Animations', 'Visibility Conditions' ); + $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' ), + '' . __( 'Add-on Blocks', 'otter-blocks' ) . '', + '' . __( 'Enhanced Animations', 'otter-blocks' ) . '', + '' . __( 'Visibility Conditions', 'otter-blocks' ) . '' + ); $notice_html .= '

'; diff --git a/inc/render/class-review-block.php b/inc/render/class-review-block.php index 2967fe926..0f7db37c7 100644 --- a/inc/render/class-review-block.php +++ b/inc/render/class-review-block.php @@ -85,8 +85,12 @@ function() use ( $attributes, $post_id ) { $html .= '
'; $html .= $this->get_overall_stars( $this->get_overall_ratings( $attributes['features'] ), $scale ); $html .= '
'; - // translators: Overall rating from 1 to 10. - $html .= ' ' . sprintf( __( '%1$g out of %2$g', 'otter-blocks' ), $this->get_overall_ratings( $attributes['features'], $scale ), 10 / $scale ) . ''; + $html .= ' ' . 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 + ) . ''; $html .= '
'; if ( ( isset( $attributes['price'] ) && ! empty( $attributes['price'] ) ) || isset( $attributes['discounted'] ) ) { @@ -133,9 +137,12 @@ function() use ( $attributes, $post_id ) { $html .= '
'; $html .= $this->get_overall_stars( $feature['rating'], $scale ); $html .= '
'; - - // translators: Overall rating from 1 to 10. - $html .= ' ' . sprintf( __( '%1$g out of %2$g', 'otter-blocks' ), 1 <= round( $feature['rating'] / $scale, 1 ) ? round( $feature['rating'] / $scale, 1 ) : 1, 10 / $scale ) . ''; + $html .= ' ' . 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 + ) . ''; $html .= ' ';