Repository navigation
Let the design kit's authored copy reach the string catalog - #394
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The 2026-09-02 catalog syncs (#390, #392) exposed a blind spot:
SWIFT_EMIT_LOC_STRINGSonly records literals that form aLocalizedStringKey, and the OGDesign components take their display text asString— 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 ownTextsplit: the concreteLocalizedStringKeyinitializer wins for literals, and a genericStringProtocol/verbatim:overload keeps runtime values (model names, error descriptions, version strings) out of the catalog.OGSectionheader/footer,OGStatTile.caption,InfoStatusRowtitle/info →LocalizedStringKeyoutright (every call site is a literal;InfoStatusRow.statusstaysString)OGRowtitle/subtitle,OGRowValue,OGToggle,OGNotice,OGStatusLabel,OGBadge→Text-backed storage with dual initializers;OGRowgainsverbatimValue:for a localized title beside a runtime value (Version/Build rows).uppercased()to.textCase(.uppercase)so the as-written VoiceOver labels keep working from the same sourcefeatureRow(paywall) andmaskingSummary/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-coveredspokenLabel/spokenSummaryhelpers 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 syncwith--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
SWIFT_EMIT_LOC_STRINGS=NO; the catalog delta contains only the sync🤖 Generated with Claude Code