Repository navigation
Conversation
The Sleep tab still showed English on a translated phone: the screen subtitle, the "Last night / Sleep performance" hero with its score word and source badge, the sleep-marks header, the nap summary, the "why this sleep" explainer, the stage names and insight line, the night detail tiles, the sleep-debt ledger and its sentences, the trend and consistency cards, and the night editor's labels and picker titles. Move that copy into string resources for all eight locales. Where the iOS catalogue already translates the same English sentence, its translation is reused so both platforms read alike; the remaining strings are new translations. "N nights ago" and "the last N nights" are plurals, so Polish and Russian get their few/many forms. The English stage names and "On-device" stay the internal keys the code switches on; only what is drawn is translated. Helpers covered by JVM tests return a resource id (sleepScoreWordRes, debtCaptionRes, mainSleepReasonCopy), and the tests read the English value from values/strings.xml through a shared EnglishResources helper. Also: the consistency chart's weekday labels follow the app language instead of Locale.US, and the sleep-debt trend footer's empty value reads "—" again instead of the mis-encoded "—".
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
On the staged version of noop, the phone's Sleep tab was still largely English. The copy lived as literals in Kotlin, so the existing translations could not reach it. This moves it into string resources for all eight locales, covering the whole tab:
SleepScreen.kt: the screen subtitle, the "Last night / Sleep performance · Rest" hero with its score word (Poor/Fair/Good/Optimal) and "On-device" badge, the "Tap to log · Phase 1" sleep-marks header, the nap summary (Main sleep / Nap(s) / Total), the "why this sleep" explainer, the Oura raw-stages note, the stage names and the per-stage insight line, the delete / cannot-save messages and the accessibility labels.SleepHeroLogic.kt: "Last night" and "N nights ago", now a<plurals>so Polish and Russian get their few/many forms.SleepMetricCardsUi.kt: the Night detail tiles, the Sleep-debt ledger, Stages vs typical, Asleep duration and Trend cards, the Hours vs Needed and Consistency cards (legends and footers), and the empty states.SleepNightNavUi.kt: the night editor's Bedtime / Wake-up labels, the picker titles and "Pick night date".SleepFormatting.kt: the "vs typical" / "vs need" / "On target" / "Below need" captions and the three sleep-debt sentences. "The last N nights" is a plural.Implementation notes:
stageDisplayName,sourceBadgeLabel).sleepScoreWordRes,debtCaptionRes,mainSleepReasonCopy), the same approach as i18n(android): translate the Settings screen's hardcoded copy #2498. The tests read the English value fromvalues/strings.xmlthrough a shared test helper,EnglishResources, so they still assert the text an English user sees.Locale.US, and the sleep-debt trend footer's empty value reads—again instead of the mis-encoded—.7h 12m,6.5 h,%) are left as they are. They are shared app-wide and belong in a separate change.About the translations:
Localizable.xcstrings) already has for the same English sentence, so both platforms read alike.Android only: the iOS Sleep screen already reads these strings from the catalogue.
Type of change
How it was tested
Checklist
swift testinPackages/<name>)android/(./gradlew testFullDebugUnitTest; after a branch switch add--no-build-cache --rerun-tasks, or Gradle may fail classes you never touched)StrandDesigntokens — no hardcoded colors, fonts, or spacingdocs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues
#2498 same approach for the Settings screen