2022-12-15 23:52:03 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { _n, sprintf } from '@wordpress/i18n';
|
|
|
|
import { speak } from '@wordpress/a11y';
|
|
|
|
|
|
|
|
export const speakFoundShippingOptions = (
|
|
|
|
packageCount: number,
|
|
|
|
rateCount: number
|
|
|
|
) => {
|
|
|
|
if ( packageCount === 1 ) {
|
|
|
|
speak(
|
|
|
|
sprintf(
|
|
|
|
/* translators: %d number of shipping options found. */
|
|
|
|
_n(
|
|
|
|
'%d shipping option was found.',
|
|
|
|
'%d shipping options were found.',
|
|
|
|
rateCount,
|
2023-12-12 22:12:36 +00:00
|
|
|
'woocommerce'
|
2022-12-15 23:52:03 +00:00
|
|
|
),
|
|
|
|
rateCount
|
|
|
|
)
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
speak(
|
|
|
|
sprintf(
|
|
|
|
/* translators: %d number of shipping packages packages. */
|
|
|
|
_n(
|
|
|
|
'Shipping option searched for %d package.',
|
|
|
|
'Shipping options searched for %d packages.',
|
|
|
|
packageCount,
|
2023-12-12 22:12:36 +00:00
|
|
|
'woocommerce'
|
2022-12-15 23:52:03 +00:00
|
|
|
),
|
|
|
|
packageCount
|
|
|
|
) +
|
|
|
|
' ' +
|
|
|
|
sprintf(
|
|
|
|
/* translators: %d number of shipping options available. */
|
|
|
|
_n(
|
|
|
|
'%d shipping option was found',
|
|
|
|
'%d shipping options were found',
|
|
|
|
rateCount,
|
2023-12-12 22:12:36 +00:00
|
|
|
'woocommerce'
|
2022-12-15 23:52:03 +00:00
|
|
|
),
|
|
|
|
rateCount
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|