Skip to content

[PM-35700] fix(about): localize Version label with parameterized string resource (#6824)#6827

Merged
david-livefront merged 1 commit intobitwarden:mainfrom
mvanhorn:osc/6824-version-localize
Apr 23, 2026
Merged

[PM-35700] fix(about): localize Version label with parameterized string resource (#6824)#6827
david-livefront merged 1 commit intobitwarden:mainfrom
mvanhorn:osc/6824-version-localize

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Apr 23, 2026

Closes #6824 (PM-35678).

Problem

On the About screen, the "Version: ..." line was built as an interpolated string:

version = "Version: ${buildInfoManager.versionData}".asText()

"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

  • Add version_x to the :ui module's values/strings.xml, following the existing created ("Created: %1$s") and default_text ("Default (%1$s)") patterns for "Label: ${value}" layouts.
  • Use BitwardenString.version_x.asText(buildInfoManager.versionData) in AboutViewModel.
  • Include a comment attribute explaining %1$s for 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:testStandardDebugUnitTest locally — 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_STATE is a static AboutState fixture passed through SavedStateHandle, so it doesn't exercise the initial-state computation path this change touches.
  • AboutScreen.kt preview (line 332) and AboutScreenTest.kt (line 278) build the version string themselves for display-only verification and don't reference BitwardenString.version_x, so they don't need updating.

Happy to update tests or adjust if there's a convention I missed.

…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
@mvanhorn mvanhorn requested review from a team and david-livefront as code owners April 23, 2026 08:14
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

@bitwarden-bot
Copy link
Copy Markdown

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-35700
Link: https://bitwarden.atlassian.net/browse/PM-35700

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title fix(about): localize Version label with parameterized string resource (#6824) [PM-35700] fix(about): localize Version label with parameterized string resource (#6824) Apr 23, 2026
@david-livefront david-livefront added t:bug Change Type - Bug and removed needs-qa labels Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.08%. Comparing base (c01fc62) to head (0a76e93).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (c01fc62) and HEAD (0a76e93). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (c01fc62) HEAD (0a76e93)
app-data 1 0
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     
Flag Coverage Δ
app-data ?
app-ui-auth-tools 20.29% <0.00%> (-0.04%) ⬇️
app-ui-platform 15.48% <100.00%> (-0.04%) ⬇️
app-ui-vault 25.90% <0.00%> (+<0.01%) ⬆️
authenticator 6.65% <0.00%> (-0.01%) ⬇️
lib-core-network-bridge 4.20% <0.00%> (-0.02%) ⬇️
lib-data-ui 1.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

Logo
Checkmarx One – Scan Summary & Detailsad714add-2ba8-445b-ba96-e1655c304e8e

Great job! No new security vulnerabilities introduced in this pull request

@david-livefront david-livefront added this pull request to the merge queue Apr 23, 2026
@david-livefront
Copy link
Copy Markdown
Collaborator

Thanks @mvanhorn This looks great!

Merged via the queue into bitwarden:main with commit d209235 Apr 23, 2026
23 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-pr t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PM-35678] Hardcoded "Version" string in About screen (not marked for translation)

4 participants