Merge pull request #26411 from barryhughes/patch-1

Pass the result of _n() through sprintf() to ensure placeholders are replaced
This commit is contained in:
Christopher Allford 2020-05-11 20:06:54 -07:00 committed by GitHub
commit ee01d42192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -466,12 +466,15 @@ class WC_Form_Handler {
if ( WC_Rate_Limiter::retried_too_soon( $rate_limit_id ) ) {
wc_add_notice(
/* translators: %d number of seconds */
_n(
'You cannot add a new payment method so soon after the previous one. Please wait for %d second.',
'You cannot add a new payment method so soon after the previous one. Please wait for %d seconds.',
$delay,
'woocommerce'
sprintf(
/* translators: %d number of seconds */
_n(
'You cannot add a new payment method so soon after the previous one. Please wait for %d second.',
'You cannot add a new payment method so soon after the previous one. Please wait for %d seconds.',
$delay,
'woocommerce'
),
$delay
),
'error'
);