Skip to content

#886 Localisation: Files and Terminal text - #954

Closed
ivanfenenko wants to merge 1 commit into
feature/886-l10n-homefrom
feature/886-l10n-files
Closed

ivanfenenko wants to merge 1 commit into
feature/886-l10n-homefrom
feature/886-l10n-files

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stage 2 extraction slice for #886 (Localisation): Files and Terminal text now comes from the string files on both platforms. This is part of an unmerged stack: #933 → #952 → this pull request (base feature/886-l10n-connection). Not compiled yet. Verification happens once for the whole stack.

  • Scope:
    • Files: tree, find, File Viewer and iPad/tablet tab pane (Android ui/files/*, iOS UI/Files/*).
    • Terminal: shells list, Terminal screen, control strip (Android ui/terminal/*, iOS UI/Terminal/*).
    • Changes (ui/changes, UI/Changes) is not touched.
  • Keys: 78 new keys with matching names under files.*, file_viewer.* and terminal.*. Reused common.cancel and common.checking_server; no new common.* keys.
    • Plurals: file_viewer.line_count and file_viewer.size_bytes (Android only formats bytes itself; iOS uses the system byte formatter).
    • Placeholders are positional. The "Kotlin · 2 lines" footer is file_viewer.meta (%1$s · %2$s) around the line-count plural, so no piece is concatenated in code.
    • A few keys exist on both platforms but only one shows them today, because the apps already differ ("Opening file" vs "Loading file", "File options" vs "More options", "Check the connection and try again." vs "…to the server…", "Rendering preview", "This project has no files to show.", "The terminal didn't open.").
  • English is unchanged. The catalog values match the old literals.
  • Android Screen Models:
    • Files failure messages (FilesFolderState.Failed, FilesTreeRow.FolderError, FilesFindState.Failed, FilesViewerContent.Failed) hold UiText. The server's detail stays UiText.Verbatim; the "Check the connection to the server" fallback is a resource.
    • FilesViewerContent.Text.metaLabel, TooLarge.title/message and formatFileSize return UiText.
    • TerminalsCatalogUiState.createError is UiText.
    • Views resolve. No ViewModel calls getString.
  • iOS:
    • The two .unlocalized calls in scope are gone. FileViewerCopy returns OpenCodeText and gained binaryDetail(mimeType:); it is no longer nonisolated (only fileSize is), because OpenCodeText is main-actor under the app's default isolation.
    • FileTextDocument.metaText (nonisolated) and the snackbar/error strings (copiedPathMessage, createError) use String(localized:defaultValue:), like #886 Localisation: Connection and onboarding text #952's snackbars.
    • File names, paths, MIME types, language names, the find query, shell and project titles stay verbatim inside placeholders.
  • Terminal key caps: "Esc", "Tab" and the spoken labels (Ctrl-C, Up, Down, Left, Right) are keys. The "^C" cap is a symbol and stays verbatim in a constant.
  • Developer tools: "Open in Highlighting Lab" (Lab builds only) stays untranslated, as for other developer surfaces.

Checks

  • node scripts/check-string-keys.mjs: pass, 191 shared keys (192 Android names including the allowlisted app_name).
  • node scripts/check-hardcoded-text.mjs --list: zero findings in the files in scope. Total 928 → 785 on this branch.
  • xmllint --noout on strings.xml and python3 -m json.tool on the catalog: pass. The catalog was rewritten in Xcode's format; the diff is insertions only (two runs, because keys stay sorted).
  • xcrun swiftc -parse on every changed Swift file: pass.
  • Not built and no tests run: no Gradle, xcodebuild, simulator or emulator in this slice.
  • Tests updated:
    • Android FilesViewModelTest: compares UiText, or English through EnglishStrings. New cases for the meta label and the no-detail fallback.
    • Android TerminalsCatalogViewModelTest: checks the createError resource and its English.
    • iOS FileViewerCopyTests: compares .resolved. New MIME-type case.
    • Other iOS assertions (metaText, "Path copied", createError) still compare English strings and are unchanged.

Evidence

Verified once for the whole stack.

Issue

#886. Stage 2 extraction slice; other feature areas follow in their own pull requests.

Risks / Follow-ups

  • Compile risks to watch at integration:
    • iOS: FileViewerCopy lost nonisolated.
    • iOS: HighlightCoreFileSession now reads its queue label from a static constant.
    • Android: stringResource is called inside inline let / ifBlank lambdas in composables.
    • Android: formatFileSize now returns UiText.
  • Still English or not localised, by decision:
    • Server detail in Files errors (ProjectFilesException.detail, built in the domain) stays verbatim.
    • Android file sizes keep the Locale.US decimal point and the KB/MB/GB unit symbols. Only "byte(s)" is a plural.
    • The clipboard label "File path" is not shown to users.
  • Wording that differs per platform, kept as is, each with its own key:
    • "Check the connection and try again." vs "Check the connection to the server and try again."
    • "Opening file" / "Opening image" vs "Loading file" / "Loading image".
    • "File options" vs "More options".
    • A later pass could align them.
  • Component limits:
    • iOS OpenCodeTreeRow and OpenCodeFileTabs take String, so the "ignored" tag is resolved with String(localized:) before it is passed in.
    • iOS OpenCodeSnackbarMessage.text is a String.
  • Not checked:
    • Pseudo-locales and right-to-left for these screens. The arrow keys in the control strip are physical directions; check they read correctly in right-to-left.

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-files branch from 9c63e09 to 95b00e5 Compare November 2, 2026 16:14
@ivanfenenko
ivanfenenko changed the base branch from feature/886-l10n-connection to feature/886-l10n-home November 2, 2026 16:14
@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
@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

@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 2 passes agreed on.

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

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