Fix malformed format specifiers in localized strings - #6695
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (19)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughLocalized Android resources now use valid indexed format specifiers for member counts, online counts, and selected-channel confirmation messages across Compose, UI components, sample, and documentation modules. ChangesString format corrections
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The localization fixes correct malformed format strings without changing code paths or introducing active merge risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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. A rabbit checks each counted sign Comment |
|
andremion
left a comment
There was a problem hiding this comment.
Looks good, the fix is correct and I did not find anything left over.
Separate from the diff: lint already flags all three of these as StringFormatCount, but no workflow runs a lint task, so the warnings were never seen. Would it be worth adding lint to CI for the translatable modules, or is that its own ticket?
|
Thanks! On the lint point: it is already running on PRs, it just is not visible from this repo. And it does catch this. I put the broken Italian string back and ran
as a So the useful change is promoting those ids to errors, something like |
|
Filed as AND-1529. |



Goal
Opening the delete channel confirmation dialog in the Compose UI kit crashes on Italian devices. The
translation reads
canale% 1$s, whichjava.util.Formatterparses as a space flag plus width 1followed by the conversion character
$, sostringResourcethrowsUnknownFormatConversionException.Closes AND-1528
Implementation
canale %1$s.%in the Japanese delete and leave group confirmations. It is notrecognised as a specifier, so those dialogs showed the literal
%1$sinstead of the channel name.%1d/%2dwith%1$d/%2$din the member count plurals across every locale. These parseas implicit argument plus minimum width. Latent rather than visible: the single argument cases render
identically, and
stream_ui_channel_list_member_info, where%2dwould have padded a single digitwith a leading space, has no code reference in the repo.
The crash and the full width case do not exist on
develop, where these keys were reworked. The%1dspelling does survive there in
stream-chat-android-docsand the XML sample, carried over separately.Testing
Parsed every
values*/strings.xmlin the repo the wayFormatterdoes and checked for unparseablespecifiers, invalid conversion characters, full-width lookalikes and per-quantity argument count drift
against the default locale. The defects above were the only hits, and the pass is clean afterwards.
The crash was hit on a device running the demo app in Italian. Resource only change, so no code paths
move.