Add plural keys for albums and tracks

This commit is contained in:
Alexey Remizov
2025-06-27 08:09:08 -07:00
committed by Drew Weymouth
parent bb8d677aab
commit 097310504c
6 changed files with 37 additions and 5 deletions
+4 -1
View File
@@ -98,11 +98,14 @@ func (g gridViewArtistIterator) NextN(n int) []GridViewItemModel {
if ar.AlbumCount == 1 {
albumsLabel = lang.L("album")
}
fallbackAlbumsMsg := fmt.Sprintf("%d %s", ar.AlbumCount, albumsLabel)
albumsMsg := lang.LocalizePluralKey("{{.albumsCount}} albums",
fallbackAlbumsMsg, ar.AlbumCount, map[string]string{"albumsCount": strconv.Itoa(ar.AlbumCount)})
return GridViewItemModel{
Name: ar.Name,
ID: ar.ID,
CoverArtID: ar.CoverArtID,
Secondary: []string{fmt.Sprintf("%d %s", ar.AlbumCount, albumsLabel)},
Secondary: []string{albumsMsg},
CanFavorite: true,
IsFavorite: ar.Favorite,
}