Repository navigation
Conversation
Three pieces of Apple UI stayed English in every locale: - Weekly digest (Trends): the focal points and the Effort/Charge balance line are English sentences built in StrandAnalytics. The package now also returns them as DigestFocalLine values (focalLines), and WeeklyDigestView renders those through the catalogue. focalPoints and BalanceRead.sentence are unchanged; a new test pins their exact English against the old output. - Intelligence "How this works": the view wrote "0-" with a hyphen, so the lookup key never matched the translated "0–%@" entry. Uses the en dash. - Sleep debt card: "Add about %@ to your base sleep target tonight..." had no catalogue entry. Adds 15 catalogue keys with all nine shipped locales. Android builds the same digest sentences in English in WeeklyDigest.kt; that is left for a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… questions
- The stage card subtitle builds "%@ in bed · %@ efficiency · %@" with the
stage caption as an argument; neither that key nor the two captions
("stages approximate (on-device)", "raw on-device stages") were in the
catalogue, so the whole line stayed English.
- The ten starter journal questions were always shown as their English
canonical. JournalCatalogItem.display now shows a catalogue translation for
a starter question that has not been renamed. The stored key stays the
English canonical, so logged days, WHOOP imports and Android still join on
the same string; custom and imported questions are shown as stored.
13 catalogue keys, all nine shipped locales.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Centre names - 245 strings the Apple app already looks up (String(localized:), Text and LocalizedStringKey literals, found by building NOOPiOS with SWIFT_EMIT_LOC_STRINGS) had no catalogue entry, so they showed in English in every locale: Workouts filters, Compare, Automations haptics, the Limitations legend, Settings experimental cards, Health, Sleep, Test Centre and more. All nine shipped locales are added. - Sport names: WorkoutSource.displaySport now resolves the de-camelCased sport through the catalogue (all 101 WorkoutCatalog sports plus common WHOOP / Apple Health names are added) and passes unknown names through. The workout picker, the relabel menu and the sport search use it; search matches both the English and the translated name. "Duplicate as manual" now seeds editableSport, so a copy never stores a translated name. - Test Centre: TestModeRegistry titles and blurbs (StrandAnalytics, plain English) are looked up in the catalogue at display time. - pt-PT: "Walking" was "Ambulante", "Sleep & Rest" was "Dormir e descansar", "%@ test mode" was word-for-word, and the iPhone reboot note was half English. The i18n audit's un-extracted Apple literals drop from 234 to 40; the rest live in other catalogues (StrandDesign, watch, widgets) or are format-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne twin
Android twin of the Swift DigestFocalLine change in this PR, which also
fixes the parity governance failure it caused (two new Swift functions
with no Kotlin twin).
- analytics/WeeklyDigest.kt gains DigestFocalLine (englishText), and
WeeklyDigestEngine.focalLines / moverLine, declared as twins of the Swift
functions. WeeklyDigest.focalPoints is unchanged and is now
focalLines.map { it.englishText }.
- WeeklyDigestCard renders the lines and the balance read through string
resources (14 strings and 2 plurals, in all nine Android locales) instead
of showing the English sentences.
- WeeklyDigestFocalLineTest pins focalPoints against the same strings the
Swift test captured from the pre-change code.
- Tools/parity_twin_map.json refreshed with parity_ledger --refresh-derived.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The contextual chips (CoachSuggestions) and the follow-up chips (AICoachEngine.followUpSuggestions) are English lists kept byte-identical to their Android twins, and the Coach screen rendered them as plain Strings, so they never reached the String Catalog. They are now looked up in the catalog at display time through CoachPrompts.localized, which leaves the shared lists untouched. The localized text is also what a tap sends, so the coach is asked in the user's language. Adds the 11 missing keys in all nine locales, and moves two pt-PT chips to the "tu" register. Co-Authored-By: Claude Opus 5.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.
What this PR does
Large parts of the Apple UI showed English in every locale, even though most of the screen around them was translated:
Weekly digest (Trends). The focal points ("Effort is up 12% week over week…") and the balance line ("You carried more Charge than you spent this week…") are English sentences built inside
StrandAnalytics, and the view displayed them as they were.WeeklyDigest.focalLines: [DigestFocalLine], in the same order.WeeklyDigestViewrenders those lines through the String Catalog, using the existingWeeklyMetric.localizedNameand locale-aware number and percent formatting.focalPointsandBalanceRead.sentenceare unchanged;focalPointsis nowfocalLines.map(\.englishText).Intelligence → "How this works". The view wrote
0-\(…)with a hyphen, so its key never matched the catalogue entry…0–%@…(en dash), which is already translated into every locale. The view now uses the en dash. The stale0-%lldentry is left as is.Sleep debt card. "Add about %@ to your base sleep target tonight…" had no catalogue entry.
Sleep stage card subtitle. It is built as
"%@ in bed · %@ efficiency · %@"with the stage caption as the third argument. Neither that key nor its two captions ("stages approximate (on-device)", "raw on-device stages") existed, so the whole line was English.Journal. The ten starter questions were always shown as their English canonical.
JournalCatalogItem.displaynow shows a catalogue translation for a starter question the user has not renamed. The stored key stays the English canonical, so logged days, WHOOP imports and Android still join on the same string. Custom and imported questions are shown as stored.245 catalogue keys the app already looks up but that were never added. I found them by building
NOOPiOSwithSWIFT_EMIT_LOC_STRINGS=YESand comparing the extracted.stringsdatakeys against the catalogue. They cover the Workouts filters ("All sports", "All sources"), Compare ("Each line min-max normalized…"), Automations haptics, the Limitations legend, the Settings experimental cards, Health, Sleep, Test Centre and more.Sport names.
WorkoutSource.displaySportnow resolves the de-camelCased sport through the catalogue and passes unknown names through.WorkoutCatalogsports plus the common WHOOP / Apple Health names.editableSport, so a copy never stores a translated name. Stored values stay English.Test Centre.
TestModeRegistrytitles and blurbs are plain English inStrandAnalytics; they are now looked up in the catalogue at display time.Coach chips. The contextual suggestions (
CoachSuggestions) and the follow-ups (AICoachEngine.followUpSuggestions) are English lists kept byte-identical to their Android twins, andCoachViewrendered them as plain Strings. They are now looked up in the catalogue at display time throughCoachPrompts.localized, so the shared lists are unchanged. The translated text is also what a tap sends, so the coach is asked in the user's language. Adds 11 keys. The Android chips are still English; that is left for a separate change.Tools/i18n_audit.py --platform ios --fullnow reports 40 un-extracted Apple literals, down from 234. The rest live in other catalogues (StrandDesign, watch, widgets) or are format-only strings.This adds about 430 catalogue keys, each with all nine shipped locales (de, es, fr, it, pl, pt-PT, ru, zh-Hans, zh-Hant).
Android. The weekly digest gets the same
DigestFocalLinetwin inanalytics/WeeklyDigest.kt(focalLines/moverLinedeclared as twins of the Swift functions).WeeklyDigestCardnow renders the lines through string resources: 14 strings and 2 plurals in all nine Android locales. The starter journal questions are still English on Android; that is left for a separate change.Type of change
How it was tested
swift testinPackages/StrandAnalytics: 2156 tests, 0 failures.WeeklyDigestFocalLineTests:focalPointsbyte for byte for seven scenarios. The expected strings were captured by running the same inputs against the code before this change.focalLines.map(\.englishText) == focalPoints../gradlew testFullDebugUnitTest. The newWeeklyDigestFocalLineTest(4 tests) pinsfocalPointsagainst the same strings as the Swift oracle, and the existingWeeklyDigestTest(25 tests) passes. On my machine 10 unrelated tests fail with a pt-PT JVM locale and fdlibmexp(locale-formatted dates and decimals, plus the half-tie fixed in test(analytics): skip the negative half-tie on JVMs whose exp is fdlibm #2876); the same 10 fail on a cleanupstream/main.parity_ledger.py --refresh-derived,parity_ledger.py,parity_ratchet.py --offline(errors=0) andtests.test_parity_governance_acceptance(50 OK).xcodebuildbuildsNOOPiOS(generic iOS) andStrand(macOS) with no errors.python3 Tools/i18n_audit.py --ci upstream/mainexits 0.Tools/doc_comment_lint.py: no new detached doc comments.Checklist
swift testinPackages/<name>)android/(the digest tests pass; 10 unrelated tests fail locally onupstream/maintoo)StrandDesigntokens — no hardcoded colors, fonts, or spacingdocs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues
Refs #2783
🤖 Generated with Claude Code