Skip to content

Let the design kit's authored copy reach the string catalog - #394

Merged
straff2002 merged 2 commits into
mainfrom
claude/goofy-booth-fcd45f
Sep 2, 2026
Merged

straff2002 merged 2 commits into
mainfrom
claude/goofy-booth-fcd45f

Conversation

@straff2002

Copy link
Copy Markdown
Owner

Why

The 2026-09-02 catalog syncs (#390, #392) exposed a blind spot: SWIFT_EMIT_LOC_STRINGS only records literals that form a LocalizedStringKey, and the OGDesign components take their display text as String — so whole surfaces (Export Diagnostics, Diagnostics & Support) contributed a single extractable key between them.

What

Component conversion — components whose copy is written at the call site now take LocalizedStringKey, following SwiftUI's own Text split: the concrete LocalizedStringKey initializer wins for literals, and a generic StringProtocol / verbatim: overload keeps runtime values (model names, error descriptions, version strings) out of the catalog.

  • OGSection header/footer, OGStatTile.caption, InfoStatusRow title/info → LocalizedStringKey outright (every call site is a literal; InfoStatusRow.status stays String)
  • OGRow title/subtitle, OGRowValue, OGToggle, OGNotice, OGStatusLabel, OGBadge → Text-backed storage with dual initializers; OGRow gains verbatimValue: for a localized title beside a runtime value (Version/Build rows)
  • Uppercasing moves from .uppercased() to .textCase(.uppercase) so the as-written VoiceOver labels keep working from the same source
  • featureRow (paywall) and maskingSummary/linkFooter (diagnostics) converted at the source so their literals extract; the one-line footer also stops saying "1 older line are left out"

Deliberately left as String: OGChip, OGStatusPill, OGHeroDeviceCard, OGDiscoverCard, OGSelectionRow — their copy is model-driven and their suite-covered spokenLabel/spokenSummary helpers compose sentences from the parts. Model-carried copy (settings categories, self-test names) is a separate, larger conversion if localization beyond English becomes a goal.

Catalog sync (separate commit, add-only) — re-ran the extraction pass (touch all sources → full recompile with SWIFT_EMIT_LOC_STRINGS=YES → xcstringstool sync with --skip-marking-strings-stale): 65 new keys, the previously invisible copy — diagnostics sections and notices, the Glasses Analytics disclosure, paywall feature rows, stat captions and status labels.

Verification

  • Full unit suite green on iPhone 17e sim (one "runner hung before establishing connection" flake in between, recovered by erase+reboot; zero tests had run, so nothing was masked)
  • Release configuration build green
  • Test/verification builds ran with SWIFT_EMIT_LOC_STRINGS=NO; the catalog delta contains only the sync

🤖 Generated with Claude Code

straff2002 and others added 2 commits September 2, 2026 13:38
SWIFT_EMIT_LOC_STRINGS only records literals that form a
LocalizedStringKey, so every OGDesign component that took its display
text as String was invisible to extraction - the diagnostics surfaces
yielded one key between them in the last catalog sync.

Convert the components whose copy is written at the call site to
LocalizedStringKey, following SwiftUI's own Text split: the concrete
LocalizedStringKey initializer wins for literals, and a generic
StringProtocol (or verbatim:) overload keeps runtime values -
model names, error descriptions, version strings - out of the catalog.

- OGSection header/footer, OGStatTile.caption, InfoStatusRow
  title/info: LocalizedStringKey outright (every call site is a
  literal; InfoStatusRow.status stays String - it is a runtime summary)
- OGRow title/subtitle, OGRowValue, OGToggle, OGNotice, OGStatusLabel,
  OGBadge: Text-backed storage with dual initializers; OGRow gains
  verbatimValue: for a localized title beside a runtime value
  (Version/Build rows)
- Uppercasing moves from .uppercased() to .textCase(.uppercase) so the
  as-written VoiceOver labels keep working from the same source
- featureRow (paywall), maskingSummary/linkFooter (diagnostics):
  parameter/property types converted so their literals extract; the
  one-line footer also stops saying "1 older line are left out"

OGChip, OGStatusPill, OGHeroDeviceCard, OGDiscoverCard and
OGSelectionRow keep String: their copy is model-driven and their
spoken-label helpers compose sentences from the parts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-ran the extraction pass (touch all sources, full recompile with
SWIFT_EMIT_LOC_STRINGS=YES, xcstringstool sync over the app target's
stringsdata with --skip-marking-strings-stale). Add-only: the copy the
String-typed component parameters had been hiding - diagnostics
sections and notices, the Glasses Analytics disclosure, paywall feature
rows, stat captions and status labels - now reaches the catalog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@straff2002
straff2002 merged commit 9feea56 into main Sep 2, 2026
2 checks passed
@straff2002
straff2002 deleted the claude/goofy-booth-fcd45f branch September 2, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant