Commit fcdf86f
feat(BulkSelect): add internationalization (i18n) support (#896)
Adds optional props for customizing all user-facing strings in BulkSelect
to support internationalization and custom terminology. All changes are
backward compatible with sensible English defaults.
New props:
- selectNoneLabel: Custom label for "Select none" option
- selectPageLabel: Function receiving pageCount to format "Select page" label
- selectAllLabel: Function receiving totalCount to format "Select all" label
- selectedLabel: Function receiving selectedCount to format the displayed count
Implementation details:
- Default label functions are hoisted to module level for stable references
- Label functions are called inside useMemo to prevent unnecessary re-renders
- Optimized for performance with expensive operations like pseudolocalization
- Parameter names avoid i18n reserved keywords (e.g., 'count' for pluralization)
Fixes #895
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 9032e97 commit fcdf86f
File tree
2 files changed
+54
-5
lines changed- packages/module/src/BulkSelect
2 files changed
+54
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
72 | 103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
| |||
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
| |||
73 | 89 | | |
74 | 90 | | |
75 | 91 | | |
76 | | - | |
| 92 | + | |
77 | 93 | | |
78 | 94 | | |
79 | 95 | | |
80 | | - | |
| 96 | + | |
81 | 97 | | |
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
85 | | - | |
| 101 | + | |
86 | 102 | | |
87 | 103 | | |
88 | 104 | | |
89 | 105 | | |
90 | | - | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
| 109 | + | |
| 110 | + | |
93 | 111 | | |
94 | 112 | | |
95 | 113 | | |
| |||
129 | 147 | | |
130 | 148 | | |
131 | 149 | | |
132 | | - | |
| 150 | + | |
133 | 151 | | |
134 | 152 | | |
135 | 153 | | |
| |||
0 commit comments