Fix distance rate error when splitting per diem expenses with invalid rate - #81489
srikarparsi merged 7 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65885be42b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| showConfirmModal({ | ||
| title: translate('iou.splitExpense'), | ||
| prompt: translate('iou.splitExpenseDistanceErrorModalDescription'), | ||
| prompt: isPerDiemRequest(transaction) ? translate('iou.splitExpensePerDiemRateErrorModalDescription') : translate('iou.splitExpenseDistanceErrorModalDescription'), | ||
| confirmText: translate('common.buttonConfirm'), |
There was a problem hiding this comment.
Add translations for new per diem error key
This adds a new translation key (iou.splitExpensePerDiemRateErrorModalDescription) but only defines it in src/languages/en.ts and src/languages/es.ts; the other locale files (fr/de/it/ja/nl/pl/pt-BR/zh-hans) don’t include it. When a user with one of those locales hits this error path, translate() will log a missing-translation alert in production and show the raw key string (and it throws in dev), so this becomes a user-visible regression for non‑EN/ES locales. Please add the key to the remaining locale files (even as an English fallback if needed) to keep localization behavior consistent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@marufsharifi We need support for the remaining locales as well.
There was a problem hiding this comment.
@rojiphil, what tools should I use to generate for other languages? Could you please help? thanks.
There was a problem hiding this comment.
We have a manual process currently for other translations. You can use ChatGPT, DeepLink or whatever you think will give you the best translation.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp81489-android-hybrid-001.mp4Android: mWeb Chrome81489-mweb-chrome-001.mp4iOS: HybridApp81489-ios-hybrid-001.mp4iOS: mWeb Safari81489-mweb-safari-001.mp4MacOS: Chrome / Safari81489-web-chrome-001.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
Thanks @marufsharifi for the updates.
@srikarparsi Changes LGTM.
All yours. Thanks.
🦜 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/de.ts b/src/languages/de.ts
index 4f823db0..8a523e3d 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1185,7 +1185,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: 'Diese Ausgabe kann nicht bearbeitet werden',
splitExpenseCannotBeEditedModalDescription: 'Genehmigte oder bezahlte Ausgaben können nicht bearbeitet werden',
splitExpenseDistanceErrorModalDescription: 'Bitte behebe den Fehler beim Distanzsatz und versuche es erneut.',
- splitExpensePerDiemRateErrorModalDescription: 'Bitte behebe den Fehler beim Tagessatz und versuche es erneut.',
+ splitExpensePerDiemRateErrorModalDescription: 'Bitte beheben Sie den Fehler beim Tagessatz und versuchen Sie es erneut.',
paySomeone: (name?: string) => `${name ?? 'jemand'} bezahlen`,
expense: 'Ausgabe',
categorize: 'Kategorisieren',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 9694548c..86beb4b9 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1190,7 +1190,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: 'Cette dépense ne peut pas être modifiée',
splitExpenseCannotBeEditedModalDescription: 'Les dépenses approuvées ou payées ne peuvent pas être modifiées',
splitExpenseDistanceErrorModalDescription: 'Veuillez corriger l’erreur de taux de distance, puis réessayer.',
- splitExpensePerDiemRateErrorModalDescription: 'Veuillez corriger l’erreur de taux journalier, puis réessayer.',
+ splitExpensePerDiemRateErrorModalDescription: 'Veuillez corriger l’erreur de taux de per diem et réessayer.',
paySomeone: (name?: string) => `Payer ${name ?? 'quelqu’un'}`,
expense: 'Dépense',
categorize: 'Catégoriser',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 66d75df2..6156fde8 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1183,7 +1183,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: 'Questa spesa non può essere modificata',
splitExpenseCannotBeEditedModalDescription: 'Le spese approvate o pagate non possono essere modificate',
splitExpenseDistanceErrorModalDescription: 'Correggi l’errore nella tariffa distanza e riprova.',
- splitExpensePerDiemRateErrorModalDescription: 'Correggi l’errore nella tariffa giornaliera e riprova.',
+ splitExpensePerDiemRateErrorModalDescription: 'Correggi l’errore nella tariffa diaria e riprova.',
paySomeone: (name?: string) => `Paga ${name ?? 'qualcuno'}`,
expense: 'Spesa',
categorize: 'Classifica',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 79bd5663..ed5c33b7 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1180,7 +1180,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalDescription: '承認済みまたは支払済みの経費は編集できません',
paySomeone: (name?: string) => `${name ?? '誰か'} を支払う`,
splitExpenseDistanceErrorModalDescription: '距離レートのエラーを修正して、もう一度お試しください。',
- splitExpensePerDiemRateErrorModalDescription: '日当レートのエラーを修正して、もう一度お試しください。',
+ splitExpensePerDiemRateErrorModalDescription: '日当額のエラーを修正して、もう一度お試しください。',
expense: '経費',
categorize: 'カテゴリー分け',
share: '共有',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 91778c66..dfd9f84e 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1183,7 +1183,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: 'Deze uitgave kan niet worden bewerkt',
splitExpenseCannotBeEditedModalDescription: 'Goedgekeurde of betaalde onkosten kunnen niet worden bewerkt',
splitExpenseDistanceErrorModalDescription: 'Los het foutieve afstandstarief op en probeer het opnieuw.',
- splitExpensePerDiemRateErrorModalDescription: 'Los de fout in het dagtarief op en probeer het opnieuw.',
+ splitExpensePerDiemRateErrorModalDescription: 'Los het foutieve daggeldtarief op en probeer het opnieuw.',
paySomeone: (name?: string) => `Betaal ${name ?? 'iemand'}`,
expense: 'Declaratie',
categorize: 'Categoriseren',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 6329696b..e4571465 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1183,7 +1183,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: 'Ten wydatek nie może zostać edytowany',
splitExpenseCannotBeEditedModalDescription: 'Zatwierdzonych ani opłaconych wydatków nie można edytować',
splitExpenseDistanceErrorModalDescription: 'Napraw błąd stawki za dystans i spróbuj ponownie.',
- splitExpensePerDiemRateErrorModalDescription: 'Napraw błąd stawki dziennej i spróbuj ponownie.',
+ splitExpensePerDiemRateErrorModalDescription: 'Napraw błąd stawki diety i spróbuj ponownie.',
paySomeone: (name?: string) => `Zapłać ${name ?? 'ktoś'}`,
expense: 'Wydatek',
categorize: 'Skategoryzuj',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index ad834ec8..d27e74d5 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1163,7 +1163,7 @@ const translations: TranslationDeepObject<typeof en> = {
splitExpenseCannotBeEditedModalTitle: '此报销无法编辑',
splitExpenseCannotBeEditedModalDescription: '已批准或已支付的报销无法编辑',
splitExpenseDistanceErrorModalDescription: '请修复距离费率错误后重试。',
- splitExpensePerDiemRateErrorModalDescription: '请修复每日津贴费率错误后重试。',
+ splitExpensePerDiemRateErrorModalDescription: '请修正每日津贴费率错误,然后重试。',
paySomeone: (name?: string) => `支付 ${name ?? '某人'}`,
expense: '报销',
categorize: '分类',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
|
Hi @marufsharifi, can you please implement these translations: #81489 (comment) |
|
@srikarparsi, applied. thanks. |
|
🚧 @srikarparsi 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|
Explanation of Change
The changes will show a proper error message for the user while splitting an expesnse which it's rate is already deleted from the workspace.
Fixed Issues
$ #81076
PROPOSAL: #81076 (comment)
Tests
Precondition:
Please fix the per diem rate error and try again.in the modal.Offline tests
Same as the test
QA Steps
Same as the test
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Screen.Recording.2026-02-06.at.7.10.31.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-02-06.at.7.15.46.PM.mov
iOS: Native
iosnative.mp4
iOS: mWeb Safari
Screen.Recording.2026-02-06.at.6.43.28.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-06.at.6.11.34.PM.mov