Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use ngettext in 'n items selected' text

dominik-zeglen6c24420d233a
diff --git a/saleor/static/dashboard/js/components/bulk-actions.js b/saleor/static/dashboard/js/components/bulk-actions.js
index 9e3c09b448..4d662a442e 100644
--- a/saleor/static/dashboard/js/components/bulk-actions.js
+++ b/saleor/static/dashboard/js/components/bulk-actions.js
@@ -1,18 +1,12 @@
function updateCounterSelected () {
const count = $('.select-item:checked').length;
const $counterTextNode = $('.data-table-header-action-selected-items');
- let counterText;
+ const counterText = ngettext('item selected', 'items selected', count);
- if (count === 1) {
- counterText = pgettext('bulk action select label one', 'item selected');
- } else {
- counterText = pgettext('bulk action select label multiple', 'items selected');
- }
-
- $counterTextNode.html(count ? `${count} ${counterText}` : counterText);
if (!count) {
$counterTextNode.addClass('hide');
} else {
+ $counterTextNode.html(`${count} ${counterText}`);
$counterTextNode.removeClass('hide');
}
}