Translate distance rate rename action in admin room thread#91391
Translate distance rate rename action in admin room thread#91391MelvinBot wants to merge 4 commits into
Conversation
The distance rate rename action (updatedField === 'name') was missing a translated branch in getWorkspaceCustomUnitRateUpdatedMessage, causing it to fall through to the raw English server text. This adds a new translation key and handler so the rename message displays in the user's preferred language. Co-authored-by: Sahil <thesahindia@users.noreply.github.com>
🦜 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 b3d7b174..806ceafd 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[de] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[de] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `hat den ${customUnitName}-Satz „${oldValue}“ in „${newValue}“ umbenannt`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[de] ${newValue ? '[de] enabled' : '[de] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 79a1b42e..c0782820 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[es] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[es] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `cambió el nombre de la tasa de ${customUnitName} de "${oldValue}" a "${newValue}"`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[es] ${newValue ? '[es] enabled' : '[es] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 8dbfcedf..800bd8ad 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[fr] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[fr] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `a renommé le taux ${customUnitName} de « ${oldValue} » en « ${newValue} »`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[fr] ${newValue ? '[fr] enabled' : '[fr] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/it.ts b/src/languages/it.ts
index ac95b911..9cf6e0a0 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[it] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[it] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `ha rinominato la tariffa ${customUnitName} da "${oldValue}" a "${newValue}"`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[it] ${newValue ? '[it] enabled' : '[it] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 8511f3f8..e2e08c1c 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[ja] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[ja] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `${customUnitName}のレート名を「${oldValue}」から「${newValue}」に変更しました`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[ja] ${newValue ? '[ja] enabled' : '[ja] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index e37d785e..5a0c85e6 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[nl] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[nl] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `heeft het tarief voor ${customUnitName} hernoemd van „${oldValue}” naar „${newValue}”`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[nl] ${newValue ? '[nl] enabled' : '[nl] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 3e4abff0..db5b2646 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7470,7 +7470,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[pl] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[pl] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `zmienił nazwę stawki ${customUnitName} z „${oldValue}” na „${newValue}”`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[pl] ${newValue ? '[pl] enabled' : '[pl] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 39662719..06d1bd5e 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7490,7 +7490,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[pt-BR] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[pt-BR] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `renomeou a taxa de ${customUnitName} de "${oldValue}" para "${newValue}"`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[pt-BR] ${newValue ? '[pt-BR] enabled' : '[pt-BR] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index a0beda61..03dd053d 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7515,7 +7515,7 @@ Add more spend rules to protect company cash flow.`,
}
return `[zh-hans] added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`;
},
- updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `[zh-hans] renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`,
+ updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `已将 ${customUnitName} 费率名称从“${oldValue}”重命名为“${newValue}”`,
updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => {
return `[zh-hans] ${newValue ? '[zh-hans] enabled' : '[zh-hans] disabled'} the ${customUnitName} rate "${customUnitRateName}"`;
},
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
…surgically The previous commit regenerated all language files via generateTranslations, replacing real translations with placeholder stubs (e.g. "[es] archived" instead of "archivado"). This restores the original translations from main and adds only the new updatedCustomUnitRateName key to each file. Co-authored-by: Sahil <thesahindia@users.noreply.github.com>
|
Fixed the failing checks: the previous commit ran |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppHaving issues with android |
|
@MelvinBot, mark off the items in author checklist, I have verified them but I don't have the access to edit. |
|
Checked off all items in the PR Author Checklist as requested by |
@MelvinBot, add the steps to Tests and QA, Put "same as QA" in offline test section. |
|
Updated the PR description as requested by |
@MelvinBot, replace the Tests and QA steps with these. |
|
Updated the Tests and QA Steps sections with the steps provided by |
|
@MelvinBot, mark the PR as ready for review |
|
Marked this PR as ready for review as requested by |
|
@thesahindia 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] |
|
@mjasikowski 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] |
|
@MelvinBot, apply the changes suggested in #91391 (comment) |
…ateName Co-authored-by: Sahil <thesahindia@users.noreply.github.com>
|
Applied the Polyglot Parrot translation improvements for |
|
@youssef-lr 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
thesahindia
left a comment
There was a problem hiding this comment.
@MelvinBot, please make the requested changes.
|
The suggested changes for |
|
@MelvinBot, make the changes suggested in #91391 (comment), #91391 (comment), #91391 (comment) and #91391 (comment) |
|
All 4 suggested changes are already applied — the translations in |
|
@MelvinBot, I suggested to use the smart/curly quotes (“ ”) and you have used the straight quotes ("). |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
Co-authored-by: Sahil <thesahindia@gmail.com>
|
@thesahindia the changes are applied now |




Explanation of Change
getWorkspaceCustomUnitRateUpdatedMessageinReportActionsUtils.tshandles translation forPOLICYCHANGELOG_UPDATE_CUSTOM_UNIT_RATEactions but had no branch forupdatedField === 'name'. When a distance rate was renamed, the function fell through togetReportActionText(action), returning the raw English server text regardless of the user's preferred language.This PR adds:
updatedField === 'name'branch ingetWorkspaceCustomUnitRateUpdatedMessagethat callstranslate('workspaceActions.updatedCustomUnitRateName', ...)updatedCustomUnitRateNametranslation key to all 10 language filesSince the thread body, thread header, LHN preview, and copy-to-clipboard all route through this single helper, this one change fixes all affected surfaces.
Fixed Issues
$ #91204
PROPOSAL: #91204 (comment)
Tests
Offline tests
N/A - This change only affects the display text of an existing admin room action. The translation is applied at render time from data already stored locally.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
AI Tests
npm run prettier -- --checknpm run lint-changednpm run typechecknpm test -- --testPathPattern=ReportActionsUtilsTestnpx ts-node ./scripts/generateTranslations.ts --dry-run