Merge pull request #3999 from helioguardabaxo/master

When list has just one card, to show 'card' instead of 'cards'
This commit is contained in:
Lauri Ojansivu 2021-09-08 14:49:09 +03:00 committed by GitHub
commit 2b2978b8e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -20,7 +20,7 @@ template(name="listHeader")
if showCardsCountForList cards.count
| 
span(class="cardCount") {{cardsCount}} {{_ 'cards-count'}}
span(class="cardCount") {{cardsCount}} {{cardsCountForListIsOne cards.count}}
if isMiniScreen
if currentList
if isWatching

View file

@ -85,6 +85,14 @@ BlazeComponent.extendComponent({
return limit >= 0 && count >= limit;
},
cardsCountForListIsOne(count) {
if (count === 1) {
return TAPi18n.__('cards-count-one');
} else {
return TAPi18n.__('cards-count');
}
},
events() {
return [
{