Skip to content

Commit 01e171a

Browse files
rhamiltoclaude
andcommitted
fix(BulkSelect): use specific parameter names to avoid i18n keyword conflicts
Updated function parameter names from generic 'count' to specific names (pageCount, totalCount, selectedCount) to avoid conflicts with i18n libraries like react-i18next where 'count' is a reserved keyword for pluralization. This ensures better compatibility when using the component with i18n libraries without naming collisions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 83a09dc commit 01e171a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/module/src/BulkSelect/BulkSelect.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ describe('BulkSelect component', () => {
8282
pagePartiallySelected={true}
8383
onSelect={() => null}
8484
selectNoneLabel="Aucune sélection (0)"
85-
selectPageLabel={(count) => `Sélectionner la page${count ? ` (${count})` : ''}`}
86-
selectAllLabel={(count) => `Tout sélectionner${count ? ` (${count})` : ''}`}
87-
selectedLabel={(count) => `${count} sélectionné${count > 1 ? 's' : ''}`}
85+
selectPageLabel={(pageCount) => `Sélectionner la page${pageCount ? ` (${pageCount})` : ''}`}
86+
selectAllLabel={(totalCount) => `Tout sélectionner${totalCount ? ` (${totalCount})` : ''}`}
87+
selectedLabel={(selectedCount) => `${selectedCount} sélectionné${selectedCount > 1 ? 's' : ''}`}
8888
/>
8989
);
9090

packages/module/src/BulkSelect/BulkSelect.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type BulkSelectValue = (typeof BulkSelectValue)[keyof typeof BulkSelectVa
2424

2525
const defaultSelectPageLabel = (pageCount?: number) => `Select page${pageCount ? ` (${pageCount})` : ''}`;
2626
const defaultSelectAllLabel = (totalCount?: number) => `Select all${totalCount ? ` (${totalCount})` : ''}`;
27-
const defaultSelectedLabel = (count: number) => `${count} selected`;
27+
const defaultSelectedLabel = (selectedCount: number) => `${selectedCount} selected`;
2828

2929
/** extends DropdownProps */
3030
export interface BulkSelectProps extends Omit<DropdownProps, 'toggle' | 'onSelect'> {
@@ -60,8 +60,8 @@ export interface BulkSelectProps extends Omit<DropdownProps, 'toggle' | 'onSelec
6060
selectPageLabel?: (pageCount?: number) => string;
6161
/** Custom label for "Select all" option. Receives totalCount as parameter. Defaults to "Select all (N)" */
6262
selectAllLabel?: (totalCount?: number) => string;
63-
/** Custom label formatter for selected count. Receives count as parameter. Defaults to "N selected" */
64-
selectedLabel?: (count: number) => string;
63+
/** Custom label formatter for selected count. Receives selectedCount as parameter. Defaults to "N selected" */
64+
selectedLabel?: (selectedCount: number) => string;
6565
}
6666

6767
export const BulkSelect: FC<BulkSelectProps> = ({

0 commit comments

Comments
 (0)