Skip to content

#886 Localisation: Connection and onboarding text - #952

Closed
ivanfenenko wants to merge 1 commit into
feature/886-localisation-foundationfrom
feature/886-l10n-connection
Closed

ivanfenenko wants to merge 1 commit into
feature/886-localisation-foundationfrom
feature/886-l10n-connection

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stage 2, slice 1 of 6 for #886 (Localisation): Connection setup and onboarding text now comes from the string files on both platforms. Stacked on #933 (feature/886-localisation-foundation); retarget to main after #933 merges.

  • Scope: Connection setup (instructions, host form, saved-address rows, pair-again text, buttons, remove and "Connection isn't encrypted" dialogs, error snackbars), the pairing QR scanner, Connection onboarding, App onboarding (pages, feature rows, setup guide), the privacy cover, and the app-root loading state. Same pattern as Settings › Servers in #886 Localisation foundation: string catalog, UiText, CI checks #933.
  • Keys: 100 new keys with matching names (iOS connection.setup.title.first ⇔ Android connection_setup_title_first) under connection.*, onboarding.*, privacy_cover.* and common.*. Reused common.cancel, common.remove, servers.remove_dialog.title_named and servers.remove_dialog.message where the text and meaning are the same. Placeholders are positional; no translatable pieces are concatenated.
  • English is unchanged. The catalog values match the old literals.
  • Android Screen Model: ConnectionSetupUiState exposes UiText for screenTitle, primaryActionLabel, pairAgainMessage and cleartextWarningMessage. Snackbars are a ConnectionSetupSnackbar(text: UiText) that the screen turns into OpenCodeSnackbarMessage. Saved-address rows hold UiText too. Hosts stay UiText.Verbatim. The ViewModel never calls getString.
  • iOS Screen Model: screenTitle, primaryActionLabel, address-recovery text, saved-address rows and the cleartext warning are OpenCodeText. Snackbar errors use String(localized:) with the same keys. All .unlocalized(...) calls in scope are gone.
  • Probe errors: probe errors ("Authentication failed", "Unable to reach the server", "Server reported unhealthy") use connection.error.* keys on both platforms. The shared domain messages used by Home are untouched.
  • Cleartext warning: the "Connection isn't encrypted" text moved from the domain CleartextPolicy (both platforms) to the Connection setup UI. It uses two keys: one host ("uses") and a list of hosts ("use"). Xcode rejects a catalog plural that never prints its count.
  • Onboarding step labels: "Step %1$d" is one key. The step label is still shown in capitals, now locale-aware (.textCase(.uppercase) on iOS, uppercase(Locale.getDefault()) on Android).

Checks

  • node scripts/check-string-keys.mjs: pass. 113 shared keys (114 Android names including the allowlisted app_name).
  • node scripts/check-hardcoded-text.mjs: total 1050 → 928. Zero findings left in the files in scope, including every .unlocalized there.
  • Android ./gradlew :app:assembleDebug: pass.
  • Android unit tests, 78 pass and 0 fail:
    • ConnectionSetupViewModelTest 46, new ConnectionSetupTextTest 8, CleartextPolicyTest 4.
    • UiTextTest 8, ServersUiStateTest 3, ConnectionProfileListMetaTest 3, PairingQRDecoderTest 6.
    • Tests compare the resolved English through a new test-only EnglishStrings lookup that reads res/values/strings.xml, or compare the UiText itself.
  • iOS build (Debug, iPhone 17 simulator): pass, with no long type-check warnings at 300 ms.
  • iOS tests: 68 tests in 4 suites pass (ConnectionSetupViewModelTests including new key, verbatim-host and cleartext cases, CleartextPolicyTests, OpenCodeTextTests, ConnectionProfileListMetaTests).
  • Pseudo-locales, fresh install, no server needed for these screens:
    • Android: English, en-XA and ar-XB.
    • iOS: English, double-length, right-to-left and missing-string mode.
    • Everything in scope is translated; nothing in scope shows uppercased in missing-string mode.
    • Right-to-left mirrors the layout and the back arrow on both platforms.

Evidence

Screenshots in the evidence comment.

Issue

#886. This is stage 2, slice 1 of 6; the other feature areas follow as separate pull requests.

Risks / Follow-ups

  • Credential-store error on save stays as the domain text: Android shows SecureCredentialStoreException.USER_MESSAGE through UiText.verbatim, and iOS shows the error's localizedDescription. The wording differs per platform (iOS adds the Keychain status), so it needs one shared message decided in the persistence/domain slice.
  • Clipping that comes from design-system components:
    • Onboarding feature-row details are one line and end in "…" under en-XA and double-length, because OpenCodeListItem limits subtitles to one line on both platforms.
    • The iOS Connection setup title truncates under double-length because the top bar title is single-line.
    • Fixing either changes a shared component, so it is left for a design-system follow-up.
  • Out of scope, still English: the "UNOFFICIAL" and "Running" labels inside OpenCodeSkeletonIllustration are design-system internals.
  • Possible component bug: in iOS right-to-left the scheme picker chevron in OpenCodeServerAddressInput points up instead of down.
  • Host hint: the example host macbook.local:4096 is a catalog key, so translators can adapt it. The English stays as it was.
  • Not verified:
    • On screen: saved-address rows, the pair-again state, the cleartext dialog and error snackbars (covered by unit tests).
    • The pairing QR scanner (needs a camera).
    • The privacy cover (needs App Lock).
    • No live server run: the screens in scope appear before connecting.
  • Android ktlintCheck / lintDebug were not run; CI soft-fails them on existing debt. gitleaks is not installed locally; the Secret Scan workflow covers it.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Move the user-facing text in Connection setup, the pairing QR scanner,
Connection onboarding, App onboarding, the privacy cover and the app-root
loading state into strings.xml and Localizable.xcstrings with matching keys
(connection.*, onboarding.*, privacy_cover.*, common.*). English is unchanged.

- Android: the Connection setup Screen Model now exposes UiText (titles,
  primary action, pair-again text, cleartext warning, saved-address rows and
  error snackbars); the screen resolves it. Hosts stay verbatim.
- iOS: the Screen Model returns OpenCodeText for titles, actions and
  saved-address rows; snackbar errors come from the catalog.
- The "Connection isn't encrypted" text moves from the domain CleartextPolicy
  to the Connection setup UI on both platforms.
- Tests compare resolved English (new EnglishStrings lookup on Android) and
  cover the new UiText/OpenCodeText values.
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Android (Harness_API36 emulator, per-app locale) and iOS (iPhone 17 simulator, launch-argument pseudo-languages). Fresh install, no server: these screens show before connecting, so no protocol applies.

Android: English, en-XA (long accented), ar-XB (right-to-left)

Step English en-XA ar-XB
Onboarding page 1
Connection setup
Host form
Feature rows (subtitle is one line by design)

iOS: English, double-length, right-to-left, missing-string mode (-NSShowNonLocalizedStrings YES; nothing in scope is uppercased)

Step English Double-length Right-to-left Missing strings
Onboarding page 1
Connection setup
Host form
Feature rows (subtitle is one line by design)

"UNOFFICIAL" and "Running" inside the illustrations come from the design-system skeleton illustration, which is outside this slice.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 1 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.157 · 1 pass(es) stopped early · 2 pass(es) failed

@ivanfenenko ivanfenenko mentioned this pull request Nov 3, 2026
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Superseded by #975, which combines the whole #886 localisation stack into one pull request against main. Review and merge happen there.

@ivanfenenko ivanfenenko closed this Nov 3, 2026
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