Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit be1da03

Browse files
committed
update i18n comments and add variable
1 parent b5d914c commit be1da03

File tree

2 files changed

+8
-6
lines changed
  • assets/js

2 files changed

+8
-6
lines changed

assets/js/atomic/components/product/button/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const ProductButton = ( { product, className } ) => {
103103
const getButtonText = () => {
104104
if ( Number.isFinite( cartQuantity ) && addedToCart ) {
105105
return sprintf(
106+
// translators: %s number of products in cart.
106107
_n(
107108
'%d in cart',
108109
'%d in cart',

assets/js/base/components/checkbox-list/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const CheckboxList = ( {
3939

4040
const renderedShowMore = useMemo( () => {
4141
const optionCount = options.length;
42+
const remainingOptionsCount = optionCount - limit;
4243
return (
4344
! showExpanded && (
4445
<li key="show-more" className="show-more">
@@ -51,21 +52,21 @@ const CheckboxList = ( {
5152
_n(
5253
'Show %s more option',
5354
'Show %s more options',
54-
optionCount - limit,
55+
remainingOptionsCount,
5556
'woo-gutenberg-products-block'
5657
),
57-
optionCount - limit
58+
remainingOptionsCount
5859
) }
5960
>
60-
{ // translators: %s number of options to reveal.
61-
sprintf(
61+
{ sprintf(
62+
// translators: %s number of options to reveal.
6263
_n(
6364
'Show %s more',
6465
'Show %s more',
65-
optionCount - limit,
66+
remainingOptionsCount,
6667
'woo-gutenberg-products-block'
6768
),
68-
optionCount - limit
69+
remainingOptionsCount
6970
) }
7071
</button>
7172
</li>

0 commit comments

Comments
 (0)