[PM-35700] fix(about): localize Version label with parameterized string resource (#6824)#6827
Conversation
…bitwarden#6824) The About screen built its version line with a hardcoded "Version:" prefix (`"Version: ${buildInfoManager.versionData}".asText()`), so Crowdin could not translate the label. Add a `version_x` string resource in the `:ui` module following the existing `created`/`default_text` pattern for "Label: %1$s" layouts, and use `BitwardenString.version_x.asText(buildInfoManager.versionData)` in `AboutViewModel` instead of the interpolated literal. PM-35678
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #6827 +/- ##
===========================================
- Coverage 85.58% 67.08% -18.51%
===========================================
Files 830 833 +3
Lines 61509 61200 -309
Branches 8592 8530 -62
===========================================
- Hits 52642 41054 -11588
- Misses 5900 17961 +12061
+ Partials 2967 2185 -782
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great job! No new security vulnerabilities introduced in this pull request |
|
Thanks @mvanhorn This looks great! |

Closes #6824 (PM-35678).
Problem
On the About screen, the "Version: ..." line was built as an interpolated string:
"Version:" was not a string resource, so Crowdin could not translate it and the label appeared in English regardless of the app's locale.
Change
version_xto the:uimodule'svalues/strings.xml, following the existingcreated("Created: %1$s") anddefault_text("Default (%1$s)") patterns for "Label: ${value}" layouts.BitwardenString.version_x.asText(buildInfoManager.versionData)inAboutViewModel.commentattribute explaining%1$sfor translators.Displayed text is unchanged in English ("Version: 2026.4.0 (21434)"). Other locales can now translate the label (including word order or punctuation changes they prefer).
Why a parameterized string instead of concatenation
The repo consistently uses parameterized strings (
Created: %1$s,Default (%1$s),Search %1$s) rather than concatenation with a hardcoded separator. This keeps locale-specific punctuation and word order in the translator's hands — some languages may want a non-breaking space before the colon, or the value before the label.Testing
I did not run
./gradlew app:testStandardDebugUnitTestlocally — no Android SDK in this environment. The change is self-contained: one Kotlin import, one call-site swap, one string-resource addition.AboutViewModelTest.DEFAULT_ABOUT_STATEis a staticAboutStatefixture passed throughSavedStateHandle, so it doesn't exercise the initial-state computation path this change touches.AboutScreen.ktpreview (line 332) andAboutScreenTest.kt(line 278) build the version string themselves for display-only verification and don't referenceBitwardenString.version_x, so they don't need updating.Happy to update tests or adjust if there's a convention I missed.