[4.2.x] Fixed #34278 -- Made translatable string plural-aware in SelectFilter2.js.

Bug in be63c78760.

Backport of e3a4cee081 from main
This commit is contained in:
Claude Paroz 2023-01-23 06:07:20 +01:00 committed by Mariusz Felisiak
parent fa52bb7774
commit 0fd5d16c22
1 changed files with 5 additions and 1 deletions

View File

@ -207,7 +207,11 @@ Requires core.js and SelectBox.js.
const selector = document.getElementById(field_id + '_selector_chosen');
const warning = document.getElementById(field_id + '_list-footer-display-text');
selector.className = selector.className.replace('selector-chosen--with-filtered', '');
warning.textContent = interpolate(gettext('%s selected options not visible'), [count]);
warning.textContent = interpolate(ngettext(
'%s selected option not visible',
'%s selected options not visible',
count
), [count]);
if(count > 0) {
selector.className += ' selector-chosen--with-filtered';
}