Repository navigation
#886 Localisation: Changes text - #959
Closed
ivanfenenko wants to merge 1 commit into
Closed
ivanfenenko wants to merge 1 commit into
ivanfenenko wants to merge 1 commit into
Conversation
Collaborator
Author
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.
Summary
Stage 2 of #886 (Localisation): the Changes screen text now comes from the string files on both platforms. This is part of the unmerged localisation stack (#933 → … → #957 → this pull request) and is based on
feature/886-l10n-settings(#957).changes.*keys with matching names on both platforms (iOSchanges.no_turn.title⇔ Androidchanges_no_turn_title), including 3 plurals:changes.summary.changed_files,changes.count.additionsandchanges.count.deletions. Retry reusescommon.retry. No newcommon.*keys.changes.accessibility.summary,changes.accessibility.file) filled with plural counts, so translators can reorder them. The file status words (Added, Deleted, Modified) are keys too. Before, they came from the enum name.ChangeSource.displayName/emptyTitle/emptyDetail,ChangesContentState.summaryand the accessibility labels,ChangesPhase.Error.messageandrefreshErrorare nowUiText. Server errors stayUiText.Verbatim. The ViewModel never callsgetString.ChangeSourcetext isOpenCodeText. The summary and accessibility labels stayStringand are built withString(localized:defaultValue:). All.unlocalized(...)calls in these files are gone.changes.error.turn_moved_folders.TurnDiffUnavailableitself is not changed, because Session Chat also uses it.Checks
node scripts/check-string-keys.mjs: pass (756 shared keys).node scripts/check-hardcoded-text.mjs --list: no findings left inui/changes/*orUI/Changes/*.xmllint --nooutonstrings.xmlandpython3 -m json.toolon the catalog: pass. The catalog is sorted and formatted as Xcode writes it.xcrun swiftc -parseon the changed Swift files: pass..english()on Android,.resolved/Stringon iOS). A new test on each platform checks both accessibility labels, including singular and plural counts.Evidence
None yet. Screenshots come once, for the whole stack, when it is built and verified.
Issue
#886
Risks / Follow-ups
changes.error.request_failedis used only on Android. Android falls back to "Request failed" when an error has no message. iOS uses the error'slocalizedDescription, so the iOS catalog has the key but no code reads it.changes.error.turn_moved_foldersand once as theTurnDiffUnavailableconstant (AndroidMESSAGE, iOSmessage). Session Chat still shows the constant. The Session Chat slice should switch to this key.fix/changes-source-fallback) changes the same files. It needs a rebase onto this pull request, and its "other source" hint needs keys.stringResource/resolve()calls inside the inlinemapandifBlanklambdas.ChangeSourceis still@Serializable, but its properties are now computed instead of constructor parameters.OpenCodeTextinChangeSourceswitch expressions.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.