Skip to content

Commit d3145cd

Browse files
committed
Use wp.i18n._n to handle singular/plural translations.
1 parent eeb7d1a commit d3145cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/js/_enqueues/admin/tags.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jQuery( function($) {
7575

7676
var currentCount = parseInt( $('.tablenav-pages .displaying-num').first().text().match(/\d+/) ) || 0;
7777
var itemCount = currentCount - 1 || 0;
78-
var itemText = itemCount === 1 ? wp.i18n.__('item') : wp.i18n.__('items');
79-
$('.tablenav-pages .displaying-num').text( itemCount + ' ' + itemText);
78+
var itemText = wp.i18n._n( '%d item', '%d items', itemCount );
79+
$('.tablenav-pages .displaying-num').text( itemText );
8080
});
8181

8282
/**
@@ -212,8 +212,8 @@ jQuery( function($) {
212212

213213
var currentCount = parseInt( $('.tablenav-pages .displaying-num').first().text().match(/\d+/) ) || 0;
214214
var itemCount = currentCount + 1 || 0;
215-
var itemText = itemCount === 1 ? wp.i18n.__('item') : wp.i18n.__('items');
216-
$('.tablenav-pages .displaying-num').text( itemCount + ' ' + itemText);
215+
var itemText = wp.i18n._n( '%d item', '%d items', itemCount );
216+
$('.tablenav-pages .displaying-num').text( itemText );
217217

218218
if ( itemCount === 1 ) {
219219
$('.tablenav').show();

0 commit comments

Comments
 (0)