Repository navigation
Conversation
…on expenses Co-authored-by: thelullabyy <[email protected]>
Co-authored-by: thelullabyy <[email protected]>
Co-authored-by: thelullabyy <[email protected]>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/el.ts b/src/languages/el.ts
index 02768e9a..5688e78f 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -144,7 +144,7 @@ const translations: TranslationDeepObject<typeof en> = {
perPerson: 'ανά άτομο',
reservationNightsWithNightlyRate: ({count, nightlyRate}: {count: number; nightlyRate: string}) => ({
one: `1 διανυκτέρευση • ${nightlyRate} ανά διανυκτέρευση`,
- other: `${count} διανυκτερεύσεις • ${nightlyRate} ανά διανυκτέρευση`,
+ other: `${count} νύχτες • ${nightlyRate} ανά νύχτα`,
}),
phone: 'Τηλέφωνο',
phoneNumber: 'Αριθμός τηλεφώνου',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 350acfc3..0e2e7035 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -140,7 +140,7 @@ const translations: TranslationDeepObject<typeof en> = {
addCardTermsOfService: 'Conditions d’utilisation d’Expensify',
perPerson: 'par personne',
reservationNightsWithNightlyRate: ({count, nightlyRate}: {count: number; nightlyRate: string}) => ({
- one: `${count} nuit • ${nightlyRate} par nuit`,
+ one: `1 nuit • ${nightlyRate} par nuit`,
other: `${count} nuits • ${nightlyRate} par nuit`,
}),
phone: 'Téléphone',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f59993e8..ae410a8b 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -140,8 +140,8 @@ const translations: TranslationDeepObject<typeof en> = {
addCardTermsOfService: 'Expensify 利用規約',
perPerson: '1人あたり',
reservationNightsWithNightlyRate: ({count, nightlyRate}: {count: number; nightlyRate: string}) => ({
- one: `1 泊 • 1泊あたり ${nightlyRate}`,
- other: `${count} 泊 • 1泊あたり ${nightlyRate}`,
+ one: `1泊 • 1泊あたり${nightlyRate}`,
+ other: `${count}泊・1泊あたり${nightlyRate}`,
}),
phone: '電話',
phoneNumber: '電話番号',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index f51a2345..9c619fe8 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -145,8 +145,6 @@ const translations: TranslationDeepObject<typeof en> = {
perPerson: 'na osobę',
reservationNightsWithNightlyRate: ({count, nightlyRate}: {count: number; nightlyRate: string}) => ({
one: `1 noc • ${nightlyRate} za noc`,
- few: `${count} noce • ${nightlyRate} za noc`,
- many: `${count} nocy • ${nightlyRate} za noc`,
other: `${count} nocy • ${nightlyRate} za noc`,
}),
phone: 'Telefon',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 45469451..b65a2e0c 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -140,7 +140,7 @@ const translations: TranslationDeepObject<typeof en> = {
addCardTermsOfService: 'Termos de Serviço da Expensify',
perPerson: 'por pessoa',
reservationNightsWithNightlyRate: ({count, nightlyRate}: {count: number; nightlyRate: string}) => ({
- one: `${count} noite • ${nightlyRate} por noite`,
+ one: `1 noite • ${nightlyRate} por noite`,
other: `${count} noites • ${nightlyRate} por noite`,
}),
phone: 'Telefone',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
🤖 Web test steps verification results: Step 1 passed: a workspace expense with a category shows the Category row with no hint. Steps 2 and 3 were not tested. The automated tester can't run JS in the page, so it couldn't add the reservation dates. These results say nothing about whether the hint works, so a person needs to run the
|




Explanation of Change
When SmartScan finds hotel reservation dates on a receipt, category and workspace limits are checked against the per-night average instead of the total. Nothing in the expense view explained this, so a $2,800 hotel stay with a $500 category limit showed no violation and no reason why.
This PR adds a muted hint under the Category row of the expense view, for example
3 nights • $233.33 per night.MoneyRequestViewcalls the samegetReservationNightshelper that the limit check inViolationsUtilsuses, so the hint and the limit always agree on the night count. The nightly rate is the displayed amount divided by the nights, formatted withconvertToDisplayString. This follows the existing per-attendee amount pattern.MenuItem.HelpTextafter any category error, the same way the Distance row shows its hint.common.reservationNightsWithNightlyRate({count, nightlyRate}), in all 11 locales. The whole phrase is one key so each language can set its own word order (Japanese and Chinese put the amount after "per night"). Polish usesone,few, andmanyforms.MoneyRequestViewTest.tsx: a 3-night stay shows the hint, and a 1-night stay doesn't.AI Tests (run by MelvinBot on this branch):
npm run typecheck: passednpm run linton changed files: passedoxfmt(npm run fmt): no changesnpm run spell-changed: 0 issuesnpm run react-compiler-compliance-check check src/components/ReportActionItem/MoneyRequestView.tsx: passednpm test -- tests/ui/MoneyRequestViewTest.tsx: 35 of 35 passed, including the 2 new testsnpm testsuite and the Storybook smoke test. CI covers them.To test in dev, open a workspace expense that has a category, then run this in the browser console and confirm the hint appears under Category:
Onyx.merge('transactions_<transactionID>', {receipt: {hotelReservationStartDate: '2026-10-01', hotelReservationEndDate: '2026-10-04'}})Change the end date to
2026-10-02and confirm the hint disappears.Fixed Issues
$ #102558
PROPOSAL: #102558 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
iOS: mWeb Safari
MacOS: Chrome / Safari