Repository navigation
refactor: move the remaining app text into strings.xml - #70
Merged
Merged
Conversation
Reducers, models, enums and errors have no composition to call stringResource in. localized() and localizedPlural() read a string resource through a StringsClient dependency and return a plain String, so types and callers stay as they are. Under unit tests the client returns the English text from the XML files, so tests keep asserting the words a user reads. Dates and numbers now follow the language of the app's text (core_language_tag) instead of always English. The app's languages are one list in app/build.gradle.kts, which also feeds Android's per-app language setting. Verified on the Android VM: app assembles, core, server and transcript unit tests pass.
Experiment titles, theme names, notice modes, device names, file sizes and staging errors now read their text through localized(). File sizes use the app's formatting locale. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Error messages, pairing link reasons, connection routes, run notices and model labels now come from server/src/main/res. UNREACHABLE_MESSAGE, FOLDER_GONE_MESSAGE and DENIED_MESSAGE become getters. ConnectionRoute gains a translated title and PastedText a translated title; rawValue and NAME stay English because they are logged or sent. Text matched against the server or sent to a model stays English. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Link menu titles, file loader errors, download progress, file sizes and link preview labels. TranscriptImagePreview pages gain labelIsPlaceholder so the viewer no longer has to recognise a placeholder label by its English words. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Call status captions, provider and key labels, fixes, diagnosis sentences, accents, sound packs and call log durations. Call errors stay English in code because they are compared, logged and sent to the model; voiceFailureDisplayText translates the known ones for the screen. Prompts and tool descriptions are unchanged. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Shortcut titles, Ask OpenCode results, Live Update statuses, notification text and share sheet messages. Manifest tile and widget labels point at string resources. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Tool row summaries, run error rows, time stamps, pending actions and link preview summaries. GitHub preview states show their translated title instead of the wire value. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Reducer errors, request bar verbs, attachment menu items, camera lens labels and model picker labels. The send button takes a verb instead of comparing its label with "Send", and the request error line recognises the HTTP status message without matching English words. Location text sent to the model stays English. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Reducer alert titles and errors, session status, starter prompts, the server pill and the background work row, whose counts are now plurals. A failed move keeps its English reason as data and shows a translated one. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Selection menu labels, row accessibility text, server status and hints, errors and the age formatters. Removes five unused DrawerTitle constants. The trace check compares the call phase instead of the status caption. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
The 175 entries read their title, summary, details, example and prompt from strings_whatsnew_entries.xml. The entry list is rebuilt when the app's language changes. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Version label, voice key and model summaries, connection card actions and status, pairing scanner hints, welcome copy and What's New actions. The connection card shows the route's translated title, and key verification errors are translated for display. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
Pairing, share and connection errors and the error phase titles. The copied error report keeps English labels. app_name is marked not translatable. Verified: assembleDebug, lintDebug and testDebugUnitTest pass for every module on the Android VM.
docs/translating.md lists the steps, and scripts/translations.py reports missing, stale and placeholder-mismatched translations for a language. AGENTS.md describes localized(). A missing translation is a lint warning rather than an error, so it shows in English instead of failing the build.
Merged
This branch was previously deployed
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.
#66 merged into #65's branch instead of
dev, so its changes never reacheddev. This is the same branch, now targetingdev.#65 moved the text written inside composables. Error titles from reducers, labels on enums and models, exception messages and the What's New entries were still English literals, so they could not be translated.
Now that text comes from
strings.xmltoo, through a newlocalized(R.string.x)in:corefor code that has no composable or Context. Adding a language is: addvalues-<code>/files, add the code toappLanguagesinapp/build.gradle.kts.docs/translating.mdhas the steps andscripts/translations.py <code>lists what a language is missing.String, and under unit testslocalizedreturns the English text, so no test changed.core_language_tag) instead of always English.Known limits, also in
docs/translating.md:Verification:
assembleDebug lintDebug testDebugUnitTestpass for every module on the Android VM (3,771 tests).estranslation that wraps every string in « », set as the app's language on an emulator, and walked the session, drawer, New Session, attachment menu, Settings and its Appearance, Sessions, Voice, What's New, Experimental and server pages. Everything was wrapped except data (project and session names) and the OpenCode brand name; dates read in Spanish. The connection and pairing screens, voice calls, notifications and widgets were not walked.