diff --git a/Sources/Brave/Frontend/Browser/Playlist/Browser/PlaylistChangeFoldersView.swift b/Sources/Brave/Frontend/Browser/Playlist/Browser/PlaylistChangeFoldersView.swift index d2558702b24..f7898adcd62 100644 --- a/Sources/Brave/Frontend/Browser/Playlist/Browser/PlaylistChangeFoldersView.swift +++ b/Sources/Brave/Frontend/Browser/Playlist/Browser/PlaylistChangeFoldersView.swift @@ -48,7 +48,7 @@ struct PlaylistChangeFoldersView: View { VStack(alignment: .leading) { Text(folder.title ?? "") .foregroundColor(Color(.braveLabel)) - Text("\(folder.playlistItems?.count ?? 0) items") + Text(folderCountLabel(folder.playlistItems?.count ?? 0)) .foregroundColor(Color(.secondaryBraveLabel)) .font(.subheadline) } @@ -102,6 +102,10 @@ struct PlaylistChangeFoldersView: View { } } } + + private func folderCountLabel(_ count: Int) -> String { + String.localizedStringWithFormat(count == 1 ? Strings.PlayList.folderItemCountSingular : Strings.PlayList.folderItemCountPlural, count) + } } private struct CreateFolderView: View { diff --git a/Sources/BraveStrings/BraveStrings.swift b/Sources/BraveStrings/BraveStrings.swift index 9ad3e2ea3b6..feecdcc3f31 100644 --- a/Sources/BraveStrings/BraveStrings.swift +++ b/Sources/BraveStrings/BraveStrings.swift @@ -1918,6 +1918,16 @@ extension Strings { NSLocalizedString("playlist.playlistAlreadyShowingBody", tableName: "BraveShared", bundle: .module, value: "Playlist is already active on another window", comment: "Playlist alert message when playlist is already showing on a different window") + + public static let folderItemCountSingular = + NSLocalizedString("playlist.foldersCountSingular", tableName: "BraveShared", bundle: .module, + value: "%d item", + comment: "Title for when there's a single item inside of a folder") + + public static let folderItemCountPlural = + NSLocalizedString("playlist.folderItemCountPlural", tableName: "BraveShared", bundle: .module, + value: "%d items", + comment: "Number of items in the playlsit folder. Example: '10 items'") } public struct PlaylistFolders {