Skip to content

Commit 4bec4e1

Browse files
committed
Add a localizable string
1 parent 1b1ac40 commit 4bec4e1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

WordPress/Classes/ViewRelated/CustomPostTypes/CustomPostListView.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct CustomPostListView: View {
2222
.overlay {
2323
if viewModel.shouldDisplayEmptyView {
2424
let emptyText = details.labels.notFound.isEmpty
25-
? "No \(details.name)"
25+
? String.localizedStringWithFormat(Strings.emptyStateMessage, details.name)
2626
: details.labels.notFound
2727
EmptyStateView(emptyText, systemImage: "doc.text")
2828
} else if viewModel.shouldDisplayInitialLoading {
@@ -190,6 +190,14 @@ private struct ErrorRow: View {
190190
}
191191
}
192192

193+
private enum Strings {
194+
static let emptyStateMessage = NSLocalizedString(
195+
"customPostList.emptyState.message",
196+
value: "No %1$@",
197+
comment: "Empty state message when no custom posts exist. %1$@ is the post type name (e.g., 'Podcasts', 'Products')."
198+
)
199+
}
200+
193201
// MARK: - Previews
194202

195203
#Preview("Fetching Placeholders") {

0 commit comments

Comments
 (0)