Skip to content

Commit

Permalink
Address translator feedback and add context to gettext (#625)
Browse files Browse the repository at this point in the history
Co-authored-by: Fulvio Notarstefano <[email protected]>
  • Loading branch information
unfulvio-godaddy and unfulvio authored Oct 6, 2023
1 parent fb3be38 commit 6c4bfb4
Show file tree
Hide file tree
Showing 17 changed files with 768 additions and 675 deletions.
18 changes: 9 additions & 9 deletions woocommerce/Lifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,18 @@ protected function generate_milestone_notice_message( $custom_message ) {
if ( $this->get_plugin()->get_reviews_url() ) {

// to be prepended at random to each milestone notice
$exclamations = array(
__( 'Awesome', 'woocommerce-plugin-framework' ),
__( 'Fantastic', 'woocommerce-plugin-framework' ),
__( 'Cowabunga', 'woocommerce-plugin-framework' ),
__( 'Congratulations', 'woocommerce-plugin-framework' ),
__( 'Hot dog', 'woocommerce-plugin-framework' ),
);
$exclamations = [
_x( 'Awesome!', 'Generic congratulatory exclamation at the start of a milestone message', 'woocommerce-plugin-framework' ),
_x( 'Fantastic!', 'Generic congratulatory exclamation at the start of a milestone message', 'woocommerce-plugin-framework' ),
_x( 'Cowabunga!', 'Generic congratulatory exclamation at the start of a milestone message', 'woocommerce-plugin-framework' ),
_x( 'Congratulations!', 'Generic congratulatory exclamation at the start of a milestone message', 'woocommerce-plugin-framework' ),
_x( 'Hot dog!', 'Generic congratulatory exclamation at the start of a milestone message', 'woocommerce-plugin-framework' ),
];

$message = $exclamations[ array_rand( $exclamations ) ] . ', ' . esc_html( $custom_message ) . ' ';
$message = $exclamations[ array_rand( $exclamations ) ] . ' ' . esc_html( $custom_message ) . ' ';

$message .= sprintf(
/* translators: Placeholders: %1$s - plugin name, %2$s - <a> tag, %3$s - </a> tag, %4$s - <a> tag, %5$s - </a> tag */
/* translators: Placeholders: %1$s - Plugin name, %2$s - Opening HTML <a> tag, %3$s - Closing HTML </a> tag, %4$s - Opening HTML <a> tag, %5$s - Closing HTML </a> tag */
__( 'Are you having a great experience with %1$s so far? Please consider %2$sleaving a review%3$s! If things aren\'t going quite as expected, we\'re happy to help -- please %4$sreach out to our support team%5$s.', 'woocommerce-plugin-framework' ),
'<strong>' . esc_html( $this->get_plugin()->get_plugin_name() ) . '</strong>',
'<a href="' . esc_url( $this->get_plugin()->get_reviews_url() ) . '">', '</a>',
Expand Down
2 changes: 1 addition & 1 deletion woocommerce/class-sv-wc-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public function add_system_status_php_information( $rows ) {
continue;
}

/* translators: As in "Value has been set as [foo], but [bar] is required". Placeholders: %1$s - current value for a PHP setting, %2$s - required value for the PHP setting */
/* translators: Context: As in "Value has been set as [foo], but [bar] is required". Placeholders: %1$s - current value for a PHP setting, %2$s - required value for the PHP setting */
$note = __( 'Set as %1$s - %2$s is required.', 'woocommerce-plugin-framework' );
}

Expand Down
Loading

0 comments on commit 6c4bfb4

Please sign in to comment.