Use string resources for connection status and tab labels - #252
Use string resources for connection status and tab labels#252danielviana wants to merge 1 commit into
Conversation
The connection status label starts out localizable and stops being so as soon as the app changes state: fragment_home.xml sets the initial value from @string/main_status_disconnected, but ButtonAnimation overwrites it with hardcoded literals on every transition. The tab labels in BottomDialogFragment have the same issue. Move all six to string resources. main_status_disconnected already existed; the other five are added with the exact strings that were previously hardcoded, so the English output is unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe home UI now reads connection-status and tab labels from Android string resources. ChangesHome UI localization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The connection-status and tab labels now use Android string resources without changing their English behavior or connection flow. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The connection status label starts out localizable and stops being so as soon as the app changes state.
fragment_home.xml:95sets the initial value from a resource:but
ButtonAnimationoverwrites that label with hardcoded literals on every state transition, somain_status_disconnectedis the only one of the four that a translator can reach — and only until the first connect.The tab labels in
BottomDialogFragmenthave the same issue:tab.setText("Peers")andtab.setText("Networks").Fix
Move the four status labels and the two tab labels to string resources.
main_status_disconnectedalready existed; the other five are added with the exact strings that were previously hardcoded.The enum now carries a
@StringRes intinstead of aString, andupdateTexttakes the resource id —TextView.setText(int)resolves it against the view's context.Notes
No behaviour change: the English output is identical, character for character.
This does not add any translations — it only makes these strings reachable by one.
Two related spots were left alone to keep the diff small: the
defaultbranch'stab.setText("Tab " + position)(unreachable with the current two-page adapter) andAboutFragment'ssetText("unknown")version fallback.Testing
./gradlew assembleDebugpasses. Verified withaapt2 dump resourcesthat the six strings compile, and confirmed the labels still render in English on a device.Summary by CodeRabbit