Translate empty report next step message#94488
Conversation
When a report is empty, getReportNextStep returned the deprecated, English-only next step. Prefer the translatable next step (messageKey WAITING_TO_ADD_TRANSACTIONS) so the "Waiting for you to add expenses" message respects the user's locale. Falls back to the deprecated format for every other case. Issue: Expensify#85123
|
Hey @abdulrahuman5196, thanks for taking this on! Quick note on the testing. I've added screenshots in the description for Web, Android Native, Android mWeb Chrome, and iOS mWeb Safari. The only one I couldn't manage is iOS Native. My Mac is really low on free space right now, so I can't build it (Xcode plus a simulator runtime takes up quite a lot). Since this fix is just a shared JS translation change, it renders the same on every platform, so iOS Native should look exactly like the others. Would you mind verifying that one when you test? And if you'd rather I capture it some other way, just let me know and I'll figure it out. cc @Julesssss, thanks a lot for offering to help with the PR earlier, really appreciate it. |
|
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
That should be fine, but could you check the item off the checklist anyway. As long as you left a comment it is okay to check it off. Else our CI check will fail and prevent merging 🙃 |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Thanks @Julesssss, makes sense! I've checked the iOS Native box off now. Appreciate the quick help 🙌 |
|
Ready for review @abdulrahuman5196 |
|
nit: In the Author's Checklist, for QA Steps, you can directly mark as |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-06-28.at.4.08.00.PM.movAndroid: mWeb ChromeScreen.Recording.2026-06-28.at.4.09.50.PM.moviOS: HybridAppScreen.Recording.2026-06-28.at.3.59.23.PM.moviOS: mWeb SafariScreen.Recording.2026-06-28.at.4.00.58.PM.movMacOS: Chrome / SafariScreen.Recording.2026-06-28.at.3.55.55.PM.mov |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @Julesssss
🎀 👀 🎀
C+ Reviewed
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.25-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
On an empty report, the next-step status message ("Waiting for you to add expenses") was always rendered in English, even when the user's locale was Spanish (or any other language).
The root cause is that two next-step systems exist in parallel: a deprecated one that hardcodes English text fragments, and a newer translatable one that uses a
messageKey. For the empty-report case,getReportNextStep(src/libs/NextStepUtils.ts) fell through to returning the deprecated (English-only) next step, so the renderer never reached the translatable path.This PR makes
getReportNextStepprefer the translatable next step when the empty-report case applies (messageKey === CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_ADD_TRANSACTIONS), so the message is rendered throughtranslate()and respects the user's locale. The deprecated format remains the fallback for every other case, so no other next-step behaviour changes.useOptimisticNextStep(src/hooks/useOptimisticNextStep.ts) now passesmoneyRequestReport?.nextStepintogetReportNextStepso the translatable value is available.Unit tests were added in
tests/unit/NextStepUtilsTest.tscovering: the translatable step is preferred for the empty-report case, the deprecated step is still used for other message keys, and higher-priority overrides (e.g. prevent-self-approval) still win.Fixed Issues
$ #85123
PROPOSAL: #85123 (comment)
Tests
Offline tests
Same as Tests — the next step for an empty report is computed optimistically on the client, so the translated message appears identically while offline.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
I don't currently have the Mac disk space to build the iOS native app. Since this is a shared-JS translation change that renders identically across platforms (verified on Web, Android: Native, Android: mWeb Chrome, and iOS: mWeb Safari), the iOS native behavior is the same. Could a reviewer kindly verify iOS: Native? Happy to provide anything needed.
iOS: mWeb Safari
MacOS: Chrome / Safari