Skip to content

Commit 6f45ab9

Browse files
committed
Localization: drop preview-string lint; document that the tooling excludes them
`xcstringstool sync` admits only unconditionally-compiled strings (`visibility: nil`) into `Localizable.xcstrings`. Preview, `PreviewProvider`, and `#if DEBUG` literals are tagged with a non-empty `visibility` by `extract` and dropped by `sync` before they can reach the catalog or GlotPress. The CI lint and the `Text(verbatim:)` preview swaps guarded a case the tooling already handles, so revert both and document the actual extract/sync contract in docs/localization.md instead.
1 parent cee64c6 commit 6f45ab9

14 files changed

Lines changed: 33 additions & 159 deletions

File tree

.buildkite/commands/lint-swiftui-preview-strings.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.buildkite/pipeline.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,6 @@ steps:
163163
- github_commit_status:
164164
context: "Verify String Catalog Coverage"
165165

166-
- label: ":sleuth_or_spy: Lint SwiftUI Preview Strings"
167-
command: .buildkite/commands/lint-swiftui-preview-strings.sh
168-
plugins: [$CI_TOOLKIT_PLUGIN]
169-
notify:
170-
- github_commit_status:
171-
context: "Lint SwiftUI Preview Strings"
172-
173166
#################
174167
# Claude Build Analysis - dynamically uploaded so Build result conditions evaluate at runtime after the wait
175168
#################

Modules/Sources/AsyncImageKit/Views/CachedAsyncImage.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ fileprivate let videoURL = URL(
177177
CachedAsyncImage(url: testURL) { image in
178178
image.resizable().scaledToFit()
179179
} placeholder: {
180-
Text(verbatim: "Loading")
180+
Text("Loading")
181181
}
182182
}
183183

184184
#Preview("Image that never loads") {
185185
CachedAsyncImage(url: nil) { _ in
186-
Text(verbatim: "This shouldn't be visible")
186+
Text("This shouldn't be visible")
187187
} placeholder: {
188188
ProgressView("Forever loading...")
189189
}
@@ -220,6 +220,6 @@ fileprivate let videoURL = URL(
220220
CachedAsyncImage(videoUrl: videoURL) { image in
221221
image.resizable().aspectRatio(contentMode: .fit)
222222
} placeholder: {
223-
Text(verbatim: "Loading")
223+
Text("Loading")
224224
}
225225
}

Modules/Sources/JetpackStats/Views/BadgeTrendIndicator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ struct BadgeTrendIndicator: View {
2626

2727
#Preview("Change Indicators") {
2828
VStack(spacing: 20) {
29-
Text(verbatim: "Examples").font(.headline)
29+
Text("Examples").font(.headline)
3030
// 15% increase in views - positive sentiment
3131
BadgeTrendIndicator(trend: TrendViewModel(currentValue: 115, previousValue: 100, metric: SiteMetric.views))
3232
// 15% decrease in views - negative sentiment
3333
BadgeTrendIndicator(trend: TrendViewModel(currentValue: 85, previousValue: 100, metric: SiteMetric.views))
3434
// 0.1% increase in views - negative sentiment
3535
BadgeTrendIndicator(trend: TrendViewModel(currentValue: 1001, previousValue: 1000, metric: SiteMetric.views))
3636

37-
Text(verbatim: "Edge Cases").font(.headline).padding(.top)
37+
Text("Edge Cases").font(.headline).padding(.top)
3838
// No change
3939
BadgeTrendIndicator(trend: TrendViewModel(currentValue: 100, previousValue: 100, metric: SiteMetric.views))
4040
// Division by zero (from 0 to 100)

Modules/Sources/JetpackStats/Views/CustomDateRangePicker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private struct QuickPeriodButtonView: View {
209209
.ignoresSafeArea()
210210

211211
VStack {
212-
Text(verbatim: "Main View")
212+
Text("Main View")
213213
.font(.largeTitle)
214214

215215
Button("Show Date Picker") {

Modules/Sources/Support/UI/FX/ShimmerEffect.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@ extension View {
4141

4242
#Preview {
4343
VStack(spacing: 30) {
44-
Text(verbatim: "Thinking...")
44+
Text("Thinking...")
4545
.font(.largeTitle)
4646
.fontWeight(.bold)
4747
.shimmer()
4848
.foregroundStyle(.gray)
4949

50-
Text(verbatim: "Thinking...")
50+
Text("Thinking...")
5151
.font(.title2)
5252
.fontWeight(.semibold)
5353
.shimmer()
5454
.foregroundStyle(.orange)
5555

56-
Text(verbatim: "Thinking...")
56+
Text("Thinking...")
5757
.font(.body)
5858
.fontWeight(.bold)
5959
.shimmer()
6060
.foregroundStyle(.blue)
6161

62-
Text(verbatim: "Thinking...")
62+
Text("Thinking...")
6363
.font(.body)
6464
.shimmer()
6565
.foregroundStyle(.pink)
6666

67-
Text(verbatim: "Thinking...")
67+
Text("Thinking...")
6868
.font(.caption)
6969
.shimmer()
7070
.foregroundStyle(.green)

Modules/Sources/Support/UI/OverlayProgressView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ struct OverlayProgressView: View {
9393
NavigationStack {
9494
List {
9595
ForEach(0..<12) { i in
96-
Text(verbatim: "Row \(i)")
96+
Text("Row \(i)")
9797
}
9898
}
9999
.navigationTitle("Demo")
100100
.toolbar {
101101
Button {
102102
shouldDisplay.toggle()
103103
} label: {
104-
Text(verbatim: "Toggle Progress View")
104+
Text("Toggle Progress View")
105105
}
106106
}
107107
}

Modules/Sources/Support/UI/Support Conversations/SupportConversationReplyView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public struct SupportConversationReplyView: View {
272272
var isPresented: Bool = true
273273

274274
NavigationStack {
275-
Text(verbatim: "Hello World").onTapGesture {
275+
Text("Hello World").onTapGesture {
276276
isPresented = true
277277
}
278278
}.sheet(isPresented: $isPresented) {

Modules/Sources/Support/UI/Support Conversations/SupportForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ private extension SupportFormArea {
422422
// MARK: - Previews
423423
#Preview {
424424
NavigationStack {
425-
Text(verbatim: "Support Form")
425+
Text("Support Form")
426426
}
427427
.sheet(isPresented: .constant(true)) {
428428
NavigationStack {

Modules/Sources/WordPressUI/Views/CardView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public struct CardView<Content: View>: View {
3333
#Preview("With Title") {
3434
CardView("Section Title") {
3535
VStack(alignment: .leading, spacing: 12) {
36-
Text(verbatim: "Card Content")
37-
Text(verbatim: "More content here")
36+
Text("Card Content")
37+
Text("More content here")
3838
.foregroundStyle(.secondary)
3939
}
4040
}
@@ -46,7 +46,7 @@ public struct CardView<Content: View>: View {
4646
HStack {
4747
Image(systemName: "star.fill")
4848
.foregroundStyle(.yellow)
49-
Text(verbatim: "Featured Item")
49+
Text("Featured Item")
5050
Spacer()
5151
}
5252
}

0 commit comments

Comments
 (0)