Skip to content

#886 Localisation: Session Chat sheets and Session Context text - #956

Closed
ivanfenenko wants to merge 1 commit into
feature/886-l10n-sessionchatfrom
feature/886-l10n-sheets
Closed

ivanfenenko wants to merge 1 commit into
feature/886-l10n-sessionchatfrom
feature/886-l10n-sheets

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stage 2 extraction slice for #886 (Localisation): Session Chat sheets and Session Context text now come from the string files on both platforms. Part of an unmerged stack: #933 → #952 → this pull request (base feature/886-l10n-connection).

Not compiled yet. Verification (builds, unit tests, pseudo-locales) happens once for the whole stack.

  • Scope:
    • Sheets on both platforms: message actions, MCP servers, Up next (pending prompts), Chip timeline intro, /btw answer, Session todos, Skills, Timeline Style picker, model / agent mode / variant picker, tool detail, tool result inspector, shell output, Background work.
    • iOS only: the Activity sheet (on Android this text lives in OpenCodeActivitySheet, a design-system component).
    • Session Context on both platforms.
  • Keys: 119 new keys, same names on both platforms (iOS session_chat_sheet.mcp.headline ⇔ Android session_chat_sheet_mcp_headline), under session_chat_sheet.* and session_context.*. Added as one block in each string file. No new common.* keys.
  • English is unchanged.
  • Plurals: counts use plurals: Up next "N waiting", grep "N matches" / "N files", source "N lines", Activity "Working N", "N tools so far", "N tools". Placeholders are positional, and no translatable pieces are concatenated.
  • Server and session content stays verbatim: MCP server names and errors, skill names, todo text, tool output, provider labels, shell commands, paths, and /btw (a command name).
  • Android Screen Model: SessionContextUiState.errorMessage and SessionContextStatItem.label are UiText. A server error message stays UiText.Verbatim; when there is none, a resource fallback is used.
  • Android tool detail: SessionChatToolDetailTarget gains localizedTitle: UiText?, used for "Provider response". title keeps the failure text.
  • iOS Session Context: stat labels are OpenCodeText keys. Error fallbacks use String(localized:).
  • iOS tool detail: SessionChatToolDetailTarget.localizedTitle: OpenCodeText? mirrors Android.
  • Todos "3 of 5 completed": the counts stay bold. Both platforms read the raw catalog pattern and put styled counts into its placeholders, so a translation can change the word order.
  • Timeline Style picker: style names, descriptions and the Recommended / Current tags map to picker keys inside the sheet. SessionChatTimelineStyle.title/subtitle (domain, shared with Settings) are untouched.
  • MCP status labels and the "N of M connected" headline map to sheet keys inside the sheet. The domain label and headline properties (and their tests) are untouched.
  • iOS text-as-key fixes: directory captions, the pull request number, diff counts, the queue position and the child-session description used Text("\(…)"), which looked them up as catalog keys. They are now Text(verbatim:).

Checks

  • node scripts/check-string-keys.mjs: pass. 232 shared keys (233 Android names including the allowlisted app_name).
  • node scripts/check-hardcoded-text.mjs: total 928 → 779. Zero findings left in the files in scope, including every .unlocalized there.
  • xmllint --noout on strings.xml and python3 -m json.tool on the catalog: pass. The catalog round-trips byte for byte in Xcode's JSON format.
  • xcrun swiftc -parse on every changed Swift file: pass.
  • Not run yet: Gradle, xcodebuild, unit tests and simulators. These run once for the whole stack.
  • Tests updated:
    • Android: SessionContextViewModelTest (verbatim error, resource fallback, stat labels), SessionFailureDetailTargetTest ("Provider response" through localizedTitle), SessionChatTimelineStylePickerSheetTest (picker names and tags).
    • iOS: SessionContextViewModelTests (stat label keys), SessionFailureDetailTargetTests, and new SessionChatTodosSheetTests (pattern splitting and the catalog lookup).

Evidence

Verified once for the whole stack.

Issue

#886

Risks / Follow-ups

  • "1 matches", "1 files", "1 lines": English is kept as today, so the one form of these plurals still says "matches", "files" and "lines". Fixing the grammar is a one-value change per key.
  • Ratios are plain strings, not plurals: "N of M connected" and "N of M completed". A plural variation with two counts would need catalog substitutions.
  • Keys used on one platform only:
    • iOS only: the accessibility text "Command, %@", "Line %d, %@", "Copies the link" and "Refreshing session context", plus the Activity sheet keys.
    • Android only: "Copy %s" and the "Code" clipboard label.
    • Each key still exists in both files, so key parity holds. Android lint may report the iOS-only keys as unused resources.
  • Still English, owned by other slices:
    • The shell status line ("Running · 1 min 12 s") and the stop-failed message. They come from SessionChatShellPresentation / SessionChatShellsCopy (timeline / region).
    • Failure action and link labels in the tool detail sheet. They arrive resolved from the failure presentation and are shown as is.
    • ToolResultPresentation titles, eyebrows and count labels.
    • OpenCodeActivityCard.stepsLabel.
  • Android counterparts outside the original list: Android SessionChatShellOutputSheet.kt and SessionChatBackgroundWorkSheet.kt were edited for the sheet labels only, to match the iOS sheets in scope.
  • Component limitation: OpenCodeActivitySectionLabel(text:) on iOS takes a String, so "Steps", "Subagents" and "Shells" resolve with String(localized:) when drawn.
  • Compile-risk spots to watch at integration:
    • Android @get:StringRes extension properties in the picker sheet.
    • Android stringResource(id) with no arguments to get the raw todos pattern.
    • iOS Bundle.main.localizedString for the same pattern.
    • iOS LocalizedStringResource stored in static let on SessionChatBackgroundWorkSheetModifier.title, which the component gallery passes to Text(_:).

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

@ivanfenenko
ivanfenenko force-pushed the feature/886-l10n-sheets branch from dc71533 to c89f039 Compare November 2, 2026 16:14
@ivanfenenko
ivanfenenko changed the base branch from feature/886-l10n-connection to feature/886-l10n-sessionchat November 2, 2026 16:15
@ivanfenenko ivanfenenko mentioned this pull request Nov 3, 2026
14 tasks done
@ivanfenenko
ivanfenenko marked this pull request as ready for review November 3, 2026 15:59
@ivanfenenko ivanfenenko mentioned this pull request Nov 3, 2026

@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.167 · 2 pass(es) failed

@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