diff --git a/src/languages/de.ts b/src/languages/de.ts index 9bb7247a8f0b..d550143d06a7 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -7433,6 +7433,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc } return `eine steuerlich rückforderbare Komponente von „${newValue}“ zum Distanzsatz „${customUnitRateName}“ hinzugefügt`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `hat den ${customUnitName}-Satz „${oldValue}“ in „${newValue}“ umbenannt`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'aktiviert' : 'deaktiviert'} den ${customUnitName}-Satz „${customUnitRateName}“`; }, diff --git a/src/languages/en.ts b/src/languages/en.ts index 892bce043fe8..3f5dba6bb687 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -7445,6 +7445,7 @@ const translations = { } return `added a tax reclaimable portion of "${newValue}" to the distance rate "${customUnitRateName}"`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `renamed the ${customUnitName} rate "${oldValue}" to "${newValue}"`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'enabled' : 'disabled'} the ${customUnitName} rate "${customUnitRateName}"`; }, diff --git a/src/languages/es.ts b/src/languages/es.ts index 1bfa19194145..f765bf2dd347 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -7236,6 +7236,7 @@ ${amount} para ${merchant} - ${date}`, } return `añadió una parte recuperable de impuestos de "${newValue}" a la tasa por distancia "${customUnitRateName}`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `cambió el nombre de la tasa de ${customUnitName} de "${oldValue}" a "${newValue}"`, updatedCustomUnitRateEnabled: (customUnitName, customUnitRateName, newValue) => { return `${newValue ? 'habilitó' : 'deshabilitó'} la tasa de ${customUnitName} "${customUnitRateName}"`; }, diff --git a/src/languages/fr.ts b/src/languages/fr.ts index ffc1167b2cfb..145703b2089d 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -7461,6 +7461,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e } return `a ajouté une partie de taxe récupérable de « ${newValue} » au taux de distance « ${customUnitRateName} »`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `a renommé le taux ${customUnitName} de « ${oldValue} » en « ${newValue} »`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'Activé' : 'Désactivé'} le taux de ${customUnitName} « ${customUnitRateName} »`; }, diff --git a/src/languages/it.ts b/src/languages/it.ts index d0c76ccca048..44a09c4c27e2 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -7419,6 +7419,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`, } return `ha aggiunto una parte di imposta rimborsabile di "${newValue}" alla tariffa distanza "${customUnitRateName}"`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `ha rinominato la tariffa ${customUnitName} da "${oldValue}" a "${newValue}"`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'abilitato' : 'disattivato'} la tariffa ${customUnitName} "${customUnitRateName}"`; }, diff --git a/src/languages/ja.ts b/src/languages/ja.ts index e0c4d62368e6..c08505b279a1 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -7337,6 +7337,7 @@ ${reportName} } return `距離単価「${customUnitRateName}」に対して、税金還付対象額「${newValue}」を追加しました`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `${customUnitName}のレート名を「${oldValue}」から「${newValue}」に変更しました`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? '有効' : '無効'} の ${customUnitName} レート「${customUnitRateName}」`; }, diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 6ed6007bdaa6..62cd8a7f6395 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -7394,6 +7394,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`, } return `heeft een terugvorderbaar belastingdeel van „${newValue}” toegevoegd aan het kilometertarief „${customUnitRateName}”`; }, + 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 `${newValue ? 'ingeschakeld' : 'uitgeschakeld'} het ${customUnitName}-tarief "${customUnitRateName}"`; }, diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 0dd56bf5fb0b..48eaf7387338 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -7389,6 +7389,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`, } return `dodano odzyskiwalną część podatku w wysokości „${newValue}” do stawki za dystans „${customUnitRateName}”`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `zmienił nazwę stawki ${customUnitName} z „${oldValue}” na „${newValue}”`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'włączone' : 'wyłączone'} stawkę jednostki niestandardowej ${customUnitName} „${customUnitRateName}”`; }, diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 360efb9281d4..1741c164ca26 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -7392,6 +7392,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`, } return `adicionou uma parte recuperável de impostos de "${newValue}" à taxa de distância "${customUnitRateName}"`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `renomeou a taxa de ${customUnitName} de "${oldValue}" para "${newValue}"`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? 'ativado' : 'desativado'} a taxa de ${customUnitName} "${customUnitRateName}"`; }, diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 8cd8bf1877d8..1fdda1f0be0c 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -7205,6 +7205,7 @@ ${reportName} } return `已将“${newValue}”的可退税部分添加到距离费率“${customUnitRateName}”中`; }, + updatedCustomUnitRateName: (customUnitName: string, oldValue: string, newValue: string) => `已将 ${customUnitName} 费率名称从“${oldValue}”重命名为“${newValue}”`, updatedCustomUnitRateEnabled: (customUnitName: string, customUnitRateName: string, newValue: boolean) => { return `${newValue ? '已启用' : '已禁用'}${customUnitName}费率“${customUnitRateName}”`; }, diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index c13b640d4c92..c2c8ce27c59d 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -3175,6 +3175,10 @@ function getWorkspaceCustomUnitRateUpdatedMessage(translate: LocalizedTranslate, const {customUnitName, customUnitRateName, updatedField, oldValue, newValue, newTaxPercentage, oldTaxPercentage} = getOriginalMessage(action as ReportAction) ?? {}; + if (customUnitName && updatedField === 'name' && typeof oldValue === 'string' && typeof newValue === 'string') { + return translate('workspaceActions.updatedCustomUnitRateName', customUnitName, oldValue, newValue); + } + if (customUnitName && customUnitRateName && updatedField === 'rate' && typeof oldValue === 'string' && typeof newValue === 'string') { return translate('workspaceActions.updatedCustomUnitRate', customUnitName, customUnitRateName, updatedField, newValue, oldValue); } diff --git a/tests/unit/ReportActionsUtilsTest.ts b/tests/unit/ReportActionsUtilsTest.ts index 487191de06a8..d1864ad82eff 100644 --- a/tests/unit/ReportActionsUtilsTest.ts +++ b/tests/unit/ReportActionsUtilsTest.ts @@ -3911,6 +3911,23 @@ describe('ReportActionsUtils', () => { const actual = ReportActionsUtils.getWorkspaceCustomUnitRateUpdatedMessage(translateLocal, action); expect(actual).toBe('disabled the Distance rate "Default Rate"'); }); + + it('should return the correct message when a rate is renamed', () => { + const action: ReportAction = { + reportActionID: '1', + actionName: CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT_RATE, + created: '', + originalMessage: { + customUnitName: 'Distance', + customUnitRateName: 'Default Rate', + updatedField: 'name', + oldValue: 'Default Rate', + newValue: 'Custom Rate', + }, + }; + const actual = ReportActionsUtils.getWorkspaceCustomUnitRateUpdatedMessage(translateLocal, action); + expect(actual).toBe('renamed the Distance rate "Default Rate" to "Custom Rate"'); + }); }); describe('didMessageMentionCurrentUser', () => {