From 6ef31b6c735ba18d02c5023cb91f4a7775610ec3 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 15:25:56 -0800 Subject: [PATCH 01/23] add initial types --- src/libs/ModifiedExpenseMessage.ts | 4 ++++ src/types/onyx/OriginalMessage.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 4df78d4fa146..b9040d304907 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -469,6 +469,10 @@ function getForReportAction({ buildMessageFragmentForValue(translateLocal, oldAttendees, attendees, translateLocal('iou.attendees'), false, setFragments, removalFragments, changeFragments); } + const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage; + if (hasPolicyRulesModifiedFields) { + } + const message = // eslint-disable-next-line @typescript-eslint/no-deprecated getMessageLine(translateLocal, `\n${translateLocal('iou.changed')}`, changeFragments) + diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index b677fc135661..f7d3b37dedd4 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -730,6 +730,12 @@ type OriginalMessageModifiedExpense = { /** Whether the updated description was generated by AI */ aiGenerated?: boolean; + + /** The policy ID that the expense was modified in */ + policyID?: string; + + /** The fields that were modified by poliy rules*/ + policyRulesModifiedFields: string[]; }; /** Model of a `travel update` report action */ From 619b400fc3cf5136f84d647648e56ffdbaf46c39 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 15:41:18 -0800 Subject: [PATCH 02/23] add more types --- src/libs/ModifiedExpenseMessage.ts | 14 ++++++++++++++ src/types/onyx/OriginalMessage.ts | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index b9040d304907..99f4b1933224 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -200,6 +200,10 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } } +function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: any, policyID: string): string { + return ''; +} + /** * Get the report action message when expense has been modified. * @@ -717,10 +721,20 @@ function getForReportActionTemp({ buildMessageFragmentForValue(translate, oldAttendees, attendees, translate('iou.attendees'), false, setFragments, removalFragments, changeFragments); } + const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage && 'policyID' in reportActionOriginalMessage; + if (hasPolicyRulesModifiedFields) { + const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; + const policyRulesModifiedFieldsMessage = getPolicyRulesModifiedFieldsMessage(translate, policyRulesModifiedFields, policyID); + if (policyRulesModifiedFieldsMessage) { + setFragments.push(policyRulesModifiedFieldsMessage); + } + } + const message = getMessageLine(translate, `\n${translate('iou.changed')}`, changeFragments) + getMessageLine(translate, `\n${translate('iou.set')}`, setFragments) + getMessageLine(translate, `\n${translate('iou.removed')}`, removalFragments); + if (message === '') { return translate('iou.changedTheExpense'); } diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index f7d3b37dedd4..3d715aa8e9be 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1,6 +1,7 @@ import type {ValueOf} from 'type-fest'; import type CONST from '@src/CONST'; import type DeepValueOf from '@src/types/utils/DeepValueOf'; +import {TaxRate} from './ExpenseRule'; import type {Attendee} from './IOU'; import type {OldDotOriginalMessageMap} from './OldDotAction'; import type {AllConnectionName} from './Policy'; @@ -735,7 +736,17 @@ type OriginalMessageModifiedExpense = { policyID?: string; /** The fields that were modified by poliy rules*/ - policyRulesModifiedFields: string[]; + policyRulesModifiedFields?: PolicyRulesModifiedFields; +}; + +type PolicyRulesModifiedFields = { + merchant?: string; + category?: string; + tag?: string; + description?: string; + billable?: string; + reimbursable?: string; + tax?: Record; }; /** Model of a `travel update` report action */ From 360776dc3a055425264b6266b1bbb8ecce74f424 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 15:45:58 -0800 Subject: [PATCH 03/23] add helper method --- src/libs/ModifiedExpenseMessage.ts | 38 ++++++++++++++++++++++++++---- src/types/onyx/OriginalMessage.ts | 1 + 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 99f4b1933224..186bbe5153d8 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -7,6 +7,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; @@ -200,8 +201,35 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } } -function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: any, policyID: string): string { - return ''; +function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string): string { + let index = 0; + const modificationCount = Object.keys(policyRulesModifiedFields).length; + const fragments = []; + + for (const [key, value] of Object.entries(policyRulesModifiedFields)) { + const isFirst = index === 0; + const isLast = index === modificationCount - 1; + + let message = ''; + + if ((key === 'reimbursable' || key === 'billable') && value) { + message += `marked the expense as "${key}"`; + } else if ((key === 'reimbursable' || key === 'billable') && !value) { + message += `marked the expense as "non-${key}"`; + } else if (isFirst) { + message += `set the ${key} to "${value}"`; + } else { + message += `${key} to "${value}"`; + } + + const shouldAddAnd = isLast && !isFirst; + fragments.push(shouldAddAnd ? `and ${message}` : message); + + index++; + } + + const policyRulesHref = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}/rules`; + return `${fragments.join(', ')} via workspace rules`; } /** @@ -724,9 +752,9 @@ function getForReportActionTemp({ const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage && 'policyID' in reportActionOriginalMessage; if (hasPolicyRulesModifiedFields) { const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; - const policyRulesModifiedFieldsMessage = getPolicyRulesModifiedFieldsMessage(translate, policyRulesModifiedFields, policyID); - if (policyRulesModifiedFieldsMessage) { - setFragments.push(policyRulesModifiedFieldsMessage); + + if (policyRulesModifiedFields && policyID) { + return getPolicyRulesModifiedFieldsMessage(translate, policyRulesModifiedFields, policyID); } } diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 3d715aa8e9be..5ea81fa9c3e2 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1250,6 +1250,7 @@ export type { PaymentMethodType, OriginalMessageSource, Decision, + PolicyRulesModifiedFields, OriginalMessageChangeLog, JoinWorkspaceResolution, OriginalMessageModifiedExpense, From 8f5b9dccd89b31e41d1fb9a840ead8bfc2b2d657 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 15:59:09 -0800 Subject: [PATCH 04/23] add translation --- src/languages/en.ts | 5 +++++ src/libs/ModifiedExpenseMessage.ts | 17 +++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 523bed340172..e599e27aca7e 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1463,6 +1463,11 @@ const translations = { amountTooLargeError: 'The total amount is too large. Lower the hours or reduce the rate.', }, correctDistanceRateError: 'Fix the distance rate error and try again.', + markedAsReimbursable: 'marked the expense as "reimbursable"', + markedAsNonReimbursable: 'marked the expense as "non-reimbursable"', + markedAsBillable: 'marked the expense as "billable"', + markedAsNonBillable: 'marked the expense as "non-billable"', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'set the' : ''} ${key} to "${value}"`, }, transactionMerge: { listPage: { diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 186bbe5153d8..a38221d7532f 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -206,25 +206,22 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli const modificationCount = Object.keys(policyRulesModifiedFields).length; const fragments = []; - for (const [key, value] of Object.entries(policyRulesModifiedFields)) { + for (const [key, value] of Object.entries(policyRulesModifiedFields) as [keyof PolicyRulesModifiedFields, string | boolean][]) { const isFirst = index === 0; const isLast = index === modificationCount - 1; let message = ''; - if ((key === 'reimbursable' || key === 'billable') && value) { - message += `marked the expense as "${key}"`; - } else if ((key === 'reimbursable' || key === 'billable') && !value) { - message += `marked the expense as "non-${key}"`; - } else if (isFirst) { - message += `set the ${key} to "${value}"`; + if (key === 'reimbursable') { + message += value ? translate('iou.markedAsReimbursable') : translate('iou.markedAsNonReimbursable'); + } else if (key === 'billable') { + message += value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); } else { - message += `${key} to "${value}"`; + message += translate('iou.updatedFieldTo', {key: translate(`common.${key}`), value, first: isFirst}); } const shouldAddAnd = isLast && !isFirst; - fragments.push(shouldAddAnd ? `and ${message}` : message); - + fragments.push(shouldAddAnd ? `${translate('common.and')} ${message}` : message); index++; } From 34f15483ba066d70352d6b2a1b39978450d650bd Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:01:59 -0800 Subject: [PATCH 05/23] add translations for routes --- src/languages/en.ts | 1 + src/libs/ModifiedExpenseMessage.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index e599e27aca7e..76aecbed62de 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1468,6 +1468,7 @@ const translations = { markedAsBillable: 'marked the expense as "billable"', markedAsNonBillable: 'marked the expense as "non-billable"', updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'set the' : ''} ${key} to "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `via workspace rules`, }, transactionMerge: { listPage: { diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index a38221d7532f..3a90c576413e 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -225,8 +225,8 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli index++; } - const policyRulesHref = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}/rules`; - return `${fragments.join(', ')} via workspace rules`; + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}/rules`; + return `${fragments.join(', ')} ${translate('iou.viaWorkspaceRules', {route: policyRulesRoute})}`; } /** From b7ca2bf70bce275062eeec947fdcbc9e172245f6 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:07:23 -0800 Subject: [PATCH 06/23] cleanup using map --- src/libs/ModifiedExpenseMessage.ts | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 3a90c576413e..47ff8113da27 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -202,27 +202,25 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string): string { - let index = 0; - const modificationCount = Object.keys(policyRulesModifiedFields).length; - const fragments = []; + const entries = Object.entries(policyRulesModifiedFields) as [keyof PolicyRulesModifiedFields, string | boolean][]; - for (const [key, value] of Object.entries(policyRulesModifiedFields) as [keyof PolicyRulesModifiedFields, string | boolean][]) { - const isFirst = index === 0; - const isLast = index === modificationCount - 1; - - let message = ''; + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; if (key === 'reimbursable') { - message += value ? translate('iou.markedAsReimbursable') : translate('iou.markedAsNonReimbursable'); - } else if (key === 'billable') { - message += value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); - } else { - message += translate('iou.updatedFieldTo', {key: translate(`common.${key}`), value, first: isFirst}); + return value ? translate('iou.markedAsReimbursable') : translate('iou.markedAsNonReimbursable'); + } + + if (key === 'billable') { + return value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); } - const shouldAddAnd = isLast && !isFirst; - fragments.push(shouldAddAnd ? `${translate('common.and')} ${message}` : message); - index++; + return translate('iou.updatedFieldTo', {key: translate(`common.${key}`), value, first: isFirst}); + }); + + if (fragments.length > 1) { + const lastIndex = fragments.length - 1; + fragments[lastIndex] = `${translate('common.and')} ${fragments[lastIndex]}`; } const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}/rules`; From 23cfe6f7042ba68035904faf66d63000af358d0b Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:15:26 -0800 Subject: [PATCH 07/23] add tests from php --- src/types/onyx/OriginalMessage.ts | 4 +- tests/unit/ModifiedExpenseMessageTest.ts | 83 ++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 5ea81fa9c3e2..5987c53149ab 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -744,8 +744,8 @@ type PolicyRulesModifiedFields = { category?: string; tag?: string; description?: string; - billable?: string; - reimbursable?: string; + billable?: boolean; + reimbursable?: boolean; tax?: Record; }; diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 2ea0f4a43620..fd6d2abea4a3 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -798,6 +798,89 @@ describe('ModifiedExpenseMessage', () => { }); }); + describe('when', () => { + it('returns the correct text message', () => { + const reportAction = { + ...createRandomReportAction(1), + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, + originalMessage: { + policyID: '1234', + policyRulesModifiedFields: { + category: 'Travel', + merchant: "McDonald's", + billable: true, + reimbursable: true, + }, + } as OriginalMessageModifiedExpense, + }; + + const result = getForReportAction({reportAction, policyID: report.policyID}); + + const expectedResult = `set the category to "Travel", merchant to "McDonald\'s", marked the expense as "billable", and marked the expense as "reimbursable" via workspace rules`; + + expect(result).toEqual(expectedResult); + }); + + it('returns the correct text message', () => { + const reportAction = { + ...createRandomReportAction(1), + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, + originalMessage: { + policyID: '1234', + policyRulesModifiedFields: { + category: 'Travel', + merchant: "McDonald's", + }, + } as OriginalMessageModifiedExpense, + }; + + const result = getForReportAction({reportAction, policyID: report.policyID}); + + const expectedResult = `set the category to "Travel", and merchant to "McDonald\'s" via workspace rules`; + + expect(result).toEqual(expectedResult); + }); + + it('returns the correct text message', () => { + const reportAction = { + ...createRandomReportAction(1), + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, + originalMessage: { + policyID: '1234', + policyRulesModifiedFields: { + billable: true, + }, + } as OriginalMessageModifiedExpense, + }; + + const result = getForReportAction({reportAction, policyID: report.policyID}); + + const expectedResult = `marked the expense as "billable" via workspace rules`; + + expect(result).toEqual(expectedResult); + }); + + it('returns the correct text message', () => { + const reportAction = { + ...createRandomReportAction(1), + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, + originalMessage: { + policyID: '1234', + policyRulesModifiedFields: { + reimbursable: true, + billable: true, + }, + } as OriginalMessageModifiedExpense, + }; + + const result = getForReportAction({reportAction, policyID: report.policyID}); + + const expectedResult = `marked the expense as "reimbursable" and marked the expense as "billable" via workspace rules`; + + expect(result).toEqual(expectedResult); + }); + }); + describe('when the category is changed without source (backward compatibility)', () => { const reportAction = { ...createRandomReportAction(1), From 381cd6c78c9d05ae2ea7e9ed90e727fe90e508c8 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:23:34 -0800 Subject: [PATCH 08/23] add to not deprecated action --- src/libs/ModifiedExpenseMessage.ts | 8 +++++++- tests/unit/ModifiedExpenseMessageTest.ts | 14 ++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 47ff8113da27..7bdfd7cdad8f 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -496,8 +496,14 @@ function getForReportAction({ buildMessageFragmentForValue(translateLocal, oldAttendees, attendees, translateLocal('iou.attendees'), false, setFragments, removalFragments, changeFragments); } - const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage; + const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage && 'policyID' in reportActionOriginalMessage; if (hasPolicyRulesModifiedFields) { + const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; + + if (policyRulesModifiedFields && policyID) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + return getPolicyRulesModifiedFieldsMessage(translateLocal, policyRulesModifiedFields, policyID); + } } const message = diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index fd6d2abea4a3..0734c17efc63 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -1,3 +1,4 @@ +import {getEnvironmentURL} from '@libs/Environment/Environment'; import {getForReportAction, getMovedFromOrToReportMessage, getMovedReportID} from '@libs/ModifiedExpenseMessage'; // eslint-disable-next-line no-restricted-syntax -- this is required to allow mocking import * as PolicyUtils from '@libs/PolicyUtils'; @@ -799,6 +800,11 @@ describe('ModifiedExpenseMessage', () => { }); describe('when', () => { + let environmentURL: string; + beforeAll(async () => { + environmentURL = await getEnvironmentURL(); + }); + it('returns the correct text message', () => { const reportAction = { ...createRandomReportAction(1), @@ -816,7 +822,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `set the category to "Travel", merchant to "McDonald\'s", marked the expense as "billable", and marked the expense as "reimbursable" via workspace rules`; + const expectedResult = `set the category to "Travel", merchant to "McDonald\'s", marked the expense as "billable", and marked the expense as "reimbursable" via workspace rules`; expect(result).toEqual(expectedResult); }); @@ -836,7 +842,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `set the category to "Travel", and merchant to "McDonald\'s" via workspace rules`; + const expectedResult = `set the category to "Travel", and merchant to "McDonald\'s" via workspace rules`; expect(result).toEqual(expectedResult); }); @@ -855,7 +861,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `marked the expense as "billable" via workspace rules`; + const expectedResult = `marked the expense as "billable" via workspace rules`; expect(result).toEqual(expectedResult); }); @@ -875,7 +881,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `marked the expense as "reimbursable" and marked the expense as "billable" via workspace rules`; + const expectedResult = `marked the expense as "reimbursable" and marked the expense as "billable" via workspace rules`; expect(result).toEqual(expectedResult); }); From 8022c059438ff3fa234209572e9299f2338649e1 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:32:28 -0800 Subject: [PATCH 09/23] add tests, fix lowercasing/links --- src/languages/en.ts | 2 +- src/libs/ModifiedExpenseMessage.ts | 4 ++-- tests/unit/ModifiedExpenseMessageTest.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 76aecbed62de..d2f682bba1ee 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1468,7 +1468,7 @@ const translations = { markedAsBillable: 'marked the expense as "billable"', markedAsNonBillable: 'marked the expense as "non-billable"', updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'set the' : ''} ${key} to "${value}"`, - viaWorkspaceRules: ({route}: {route: string}) => `via workspace rules`, + viaWorkspaceRules: ({route}: {route: string}) => `via workspace rules`, }, transactionMerge: { listPage: { diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 7bdfd7cdad8f..c99af39144b8 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -215,7 +215,7 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli return value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); } - return translate('iou.updatedFieldTo', {key: translate(`common.${key}`), value, first: isFirst}); + return translate('iou.updatedFieldTo', {key: translate(`common.${key}`).toLowerCase(), value, first: isFirst}); }); if (fragments.length > 1) { @@ -223,7 +223,7 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli fragments[lastIndex] = `${translate('common.and')} ${fragments[lastIndex]}`; } - const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}/rules`; + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; return `${fragments.join(', ')} ${translate('iou.viaWorkspaceRules', {route: policyRulesRoute})}`; } diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 0734c17efc63..c9d35ef61a58 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -881,7 +881,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `marked the expense as "reimbursable" and marked the expense as "billable" via workspace rules`; + const expectedResult = `marked the expense as "reimbursable", and marked the expense as "billable" via workspace rules`; expect(result).toEqual(expectedResult); }); From 20165412f295ddd26e6c48595e87b8ec40dcea30 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:34:44 -0800 Subject: [PATCH 10/23] update spacing, update test names --- src/languages/en.ts | 2 +- tests/unit/ModifiedExpenseMessageTest.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index d2f682bba1ee..7c8e644a0328 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1467,7 +1467,7 @@ const translations = { markedAsNonReimbursable: 'marked the expense as "non-reimbursable"', markedAsBillable: 'marked the expense as "billable"', markedAsNonBillable: 'marked the expense as "non-billable"', - updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'set the' : ''} ${key} to "${value}"`, + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'set the ' : ''}${key} to "${value}"`, viaWorkspaceRules: ({route}: {route: string}) => `via workspace rules`, }, transactionMerge: { diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index c9d35ef61a58..4e52805b4ffb 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -799,13 +799,13 @@ describe('ModifiedExpenseMessage', () => { }); }); - describe('when', () => { + describe('when policy rules modify an expense', () => { let environmentURL: string; beforeAll(async () => { environmentURL = await getEnvironmentURL(); }); - it('returns the correct text message', () => { + it('returns the correct text message with multiple overrides', () => { const reportAction = { ...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, @@ -827,7 +827,7 @@ describe('ModifiedExpenseMessage', () => { expect(result).toEqual(expectedResult); }); - it('returns the correct text message', () => { + it('returns the correct text message with two overrides', () => { const reportAction = { ...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, @@ -847,7 +847,7 @@ describe('ModifiedExpenseMessage', () => { expect(result).toEqual(expectedResult); }); - it('returns the correct text message', () => { + it('returns the correct text message with a single override', () => { const reportAction = { ...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, @@ -866,7 +866,7 @@ describe('ModifiedExpenseMessage', () => { expect(result).toEqual(expectedResult); }); - it('returns the correct text message', () => { + it('returns the correct text message with boolean overrides', () => { const reportAction = { ...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, From 43c1701933f5972c19c7137992091c31e52f5ba2 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:38:36 -0800 Subject: [PATCH 11/23] fix spellchec --- src/types/onyx/OriginalMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 5987c53149ab..a4a10729a003 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -735,7 +735,7 @@ type OriginalMessageModifiedExpense = { /** The policy ID that the expense was modified in */ policyID?: string; - /** The fields that were modified by poliy rules*/ + /** The fields that were modified by policy rules*/ policyRulesModifiedFields?: PolicyRulesModifiedFields; }; From f453812c8e335cbb139d530a052861ed9c911447 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 16:44:51 -0800 Subject: [PATCH 12/23] translations --- src/languages/de.ts | 8 +++++++- src/languages/es.ts | 6 ++++++ src/languages/fr.ts | 10 ++++++++-- src/languages/it.ts | 10 ++++++++-- src/languages/ja.ts | 8 +++++++- src/languages/nl.ts | 10 ++++++++-- src/languages/pl.ts | 6 ++++++ src/languages/pt-BR.ts | 12 +++++++++--- src/languages/zh-hans.ts | 10 ++++++++-- 9 files changed, 67 insertions(+), 13 deletions(-) diff --git a/src/languages/de.ts b/src/languages/de.ts index a4b3fbf2348a..638fca29066d 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -1479,6 +1479,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'Der Gesamtbetrag ist zu hoch. Verringere die Stunden oder reduziere den Satz.', }, correctDistanceRateError: 'Beheben Sie den Fehler beim Entfernungssatz und versuchen Sie es erneut.', + markedAsReimbursable: 'hat die Ausgabe als „erstattungsfähig“ markiert', + markedAsNonReimbursable: 'hat die Ausgabe als „nicht erstattungsfähig“ markiert', + markedAsBillable: 'hat die Ausgabe als „verrechenbar“ markiert', + markedAsNonBillable: 'hat die Ausgabe als „nicht abrechenbar“ markiert', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'festlegen der' : ''}${key} zu "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `über Workspace-Regeln`, }, transactionMerge: { listPage: { @@ -8038,7 +8044,7 @@ Hier ist ein *Testbeleg*, um dir zu zeigen, wie es funktioniert:`, domainAdmins: 'Domain-Admins', }, gps: { - tooltip: 'GPS-Verfolgung läuft! Wenn du fertig bist, stoppe die Verfolgung unten.', + tooltip: 'GPS-Tracking läuft! Wenn du fertig bist, beende die Aufzeichnung unten.', disclaimer: 'Benutze GPS, um eine Ausgabe von deiner Reise zu erstellen. Tippe unten auf „Start“, um mit der Aufzeichnung zu beginnen.', error: {failedToStart: 'Standortverfolgung konnte nicht gestartet werden.', failedToGetPermissions: 'Die erforderlichen Standortberechtigungen konnten nicht abgerufen werden.'}, trackingDistance: 'Strecke wird verfolgt...', diff --git a/src/languages/es.ts b/src/languages/es.ts index 39e439e9d622..414235ed47d2 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1208,6 +1208,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'El importe total es demasiado alto. Reduce las horas o disminuye la tasa.', }, correctDistanceRateError: 'Corrige el error de la tasa de distancia y vuelve a intentarlo.', + markedAsReimbursable: 'marcó el gasto como "reembolsable"', + markedAsNonReimbursable: 'marcó el gasto como "no reembolsable"', + markedAsBillable: 'marcó el gasto como "facturable"', + markedAsNonBillable: 'marcó el gasto como "no facturable"', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'estableció el ' : ''}${key} a "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `a través de reglas del espacio de trabajo`, }, transactionMerge: { listPage: { diff --git a/src/languages/fr.ts b/src/languages/fr.ts index b89785f3f112..1f6914711ae2 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -1202,7 +1202,7 @@ const translations: TranslationDeepObject = { other: 'Voulez-vous vraiment supprimer ces dépenses ?', }), deleteReport: 'Supprimer le rapport', - deleteReportConfirmation: 'Voulez-vous vraiment supprimer ce rapport ?', + deleteReportConfirmation: 'Voulez-vous vraiment supprimer ce rapport ?', settledExpensify: 'Payé', done: 'Terminé', settledElsewhere: 'Payé ailleurs', @@ -1482,6 +1482,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'Le montant total est trop élevé. Réduisez le nombre d’heures ou diminuez le tarif.', }, correctDistanceRateError: 'Corrigez l’erreur de taux de distance et réessayez.', + markedAsReimbursable: 'a marqué la dépense comme « remboursable »', + markedAsNonReimbursable: 'a marqué la dépense comme « non remboursable »', + markedAsBillable: 'a marqué la dépense comme « facturable »', + markedAsNonBillable: 'a marqué la dépense comme « non facturable »', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'définir le' : ''}${key} vers "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `via les règles de l’espace de travail`, }, transactionMerge: { listPage: { @@ -8044,7 +8050,7 @@ Voici un *reçu test* pour vous montrer comment cela fonctionne :`, domainAdmins: 'Administrateurs de domaine', }, gps: { - tooltip: 'Suivi GPS en cours ! Quand vous avez terminé, arrêtez le suivi ci-dessous.', + tooltip: 'Suivi GPS en cours ! Lorsque vous avez terminé, arrêtez le suivi ci-dessous.', disclaimer: 'Utilisez le GPS pour créer une dépense à partir de votre trajet. Touchez Démarrer ci-dessous pour commencer le suivi.', error: {failedToStart: 'Impossible de démarrer le suivi de la localisation.', failedToGetPermissions: 'Échec de l’obtention des autorisations de localisation requises.'}, trackingDistance: 'Suivi de la distance...', diff --git a/src/languages/it.ts b/src/languages/it.ts index ce077164408e..13ff3e943687 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -1197,7 +1197,7 @@ const translations: TranslationDeepObject = { one: 'Sei sicuro di voler eliminare questa spesa?', other: 'Sei sicuro di voler eliminare queste spese?', }), - deleteReport: 'Elimina resoconto', + deleteReport: 'Elimina report', deleteReportConfirmation: 'Sei sicuro di voler eliminare questo report?', settledExpensify: 'Pagato', done: 'Fatto', @@ -1476,6 +1476,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'L’importo totale è troppo elevato. Riduci le ore o diminuisci la tariffa.', }, correctDistanceRateError: "Correggi l'errore nella tariffa della distanza e riprova.", + markedAsReimbursable: 'ha contrassegnato la spesa come "rimborsabile"', + markedAsNonReimbursable: 'ha contrassegnato la spesa come "non rimborsabile"', + markedAsBillable: 'ha contrassegnato la spesa come "rifatturabile"', + markedAsNonBillable: 'ha contrassegnato la spesa come "non addebitabile"', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'imposta il' : ''}${key} a "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `tramite le regole dell’area di lavoro`, }, transactionMerge: { listPage: { @@ -6878,7 +6884,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori groupBy: { [CONST.SEARCH.GROUP_BY.FROM]: 'Da', [CONST.SEARCH.GROUP_BY.CARD]: 'Carta', - [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID prelievo', + [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID prelievo', //_/\__/_/ \_,_/\__/\__/\_,_/ }, feed: 'Feed', withdrawalType: { diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 197488a8d6e6..873376654f6b 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -1474,6 +1474,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: '合計金額が大きすぎます。時間を減らすか、レートを下げてください。', }, correctDistanceRateError: '距離レートのエラーを修正して、もう一度お試しください。', + markedAsReimbursable: '経費を「払い戻し対象」としてマークしました', + markedAsNonReimbursable: '経費を「非精算」にマークしました', + markedAsBillable: '経費を「請求可能」としてマークしました', + markedAsNonBillable: '経費を「請求対象外」に設定しました', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? '設定する' : ''}${key} を「${value}」に`, + viaWorkspaceRules: ({route}: {route: string}) => `ワークスペースルール経由`, }, transactionMerge: { listPage: { @@ -7960,7 +7966,7 @@ Expensify の使い方をお見せするための*テストレシート*がこ domainAdmins: 'ドメイン管理者', }, gps: { - tooltip: 'GPS 追跡を進行中です!完了したら、下で追跡を停止してください。', + tooltip: 'GPS追跡を実行中です!完了したら、下で追跡を停止してください。', disclaimer: '移動中の経路から、GPS を使って経費を作成しましょう。下の「開始」をタップして追跡を始めてください。', error: {failedToStart: '位置情報の追跡を開始できませんでした。', failedToGetPermissions: '必要な位置情報の権限を取得できませんでした。'}, trackingDistance: '距離を追跡中...', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index f778ac977a3a..7a0b43a76230 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -1198,7 +1198,7 @@ const translations: TranslationDeepObject = { other: 'Weet je zeker dat je deze uitgaven wilt verwijderen?', }), deleteReport: 'Rapport verwijderen', - deleteReportConfirmation: 'Weet u zeker dat u dit rapport wilt verwijderen?', + deleteReportConfirmation: 'Weet je zeker dat je dit rapport wilt verwijderen?', settledExpensify: 'Betaald', done: 'Gereed', settledElsewhere: 'Elders betaald', @@ -1475,6 +1475,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'Het totale bedrag is te hoog. Verlaag het aantal uren of verlaag het tarief.', }, correctDistanceRateError: 'Los het foutieve kilometertarief op en probeer het opnieuw.', + markedAsReimbursable: 'heeft de uitgave gemarkeerd als „terugbetaalbaar”', + markedAsNonReimbursable: 'heeft de uitgave gemarkeerd als “niet-vergoedbaar”', + markedAsBillable: 'heeft de uitgave als ‘factureerbaar’ gemarkeerd', + markedAsNonBillable: 'heeft de uitgave als ‘niet-factureerbaar’ gemarkeerd', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'stel de' : ''}${key} naar "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `via werkruimte­regels`, }, transactionMerge: { listPage: { @@ -8007,7 +8013,7 @@ Hier is een *testbon* om je te laten zien hoe het werkt:`, domainAdmins: 'Domeinbeheerders', }, gps: { - tooltip: 'GPS-tracking bezig! Als je klaar bent, stop dan hieronder met tracken.', + tooltip: 'GPS-tracking bezig! Als je klaar bent, stop dan hieronder met volgen.', disclaimer: 'Gebruik GPS om een uitgave van je reis te maken. Tik hieronder op Start om het volgen te beginnen.', error: {failedToStart: 'Locatiebijhouding starten is mislukt.', failedToGetPermissions: 'Verkrijgen van vereiste locatierechten mislukt.'}, trackingDistance: 'Afstand bijhouden...', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 8e45fc3139d3..fd6d92499047 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -1474,6 +1474,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'Całkowita kwota jest zbyt wysoka. Zmniejsz liczbę godzin lub obniż stawkę.', }, correctDistanceRateError: 'Napraw błąd stawki za dystans i spróbuj ponownie.', + markedAsReimbursable: 'oznaczył wydatek jako „podlegający zwrotowi”', + markedAsNonReimbursable: 'oznaczył(-a) wydatek jako „niepodlegający zwrotowi”', + markedAsBillable: 'oznaczył(a) wydatek jako „fakturowany”', + markedAsNonBillable: 'oznaczył(a) wydatek jako „niefakturowalny”', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'ustaw the' : ''}${key} na "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `przez zasady miejsca pracy`, }, transactionMerge: { listPage: { diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index b3ff62c08ee5..c3eb683fe7c9 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -1197,7 +1197,7 @@ const translations: TranslationDeepObject = { other: 'Tem certeza de que deseja excluir estas despesas?', }), deleteReport: 'Excluir relatório', - deleteReportConfirmation: 'Você tem certeza de que deseja excluir este relatório?', + deleteReportConfirmation: 'Tem certeza de que deseja excluir este relatório?', settledExpensify: 'Pago', done: 'Concluído', settledElsewhere: 'Pago em outro lugar', @@ -1472,6 +1472,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: 'O valor total é muito alto. Reduza as horas ou diminua a tarifa.', }, correctDistanceRateError: 'Corrija o erro na taxa de distância e tente novamente.', + markedAsReimbursable: 'marcou a despesa como "reembolsável"', + markedAsNonReimbursable: 'marcou a despesa como “não reembolsável”', + markedAsBillable: 'marcou a despesa como "faturável"', + markedAsNonBillable: 'marcou a despesa como “não faturável”', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `${first ? 'definir o' : ''}${key} para "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `via regras do workspace`, }, transactionMerge: { listPage: { @@ -6851,7 +6857,7 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe groupBy: { [CONST.SEARCH.GROUP_BY.FROM]: 'De', [CONST.SEARCH.GROUP_BY.CARD]: 'Cartão', - [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID de saque', + [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: 'ID de retirada', }, feed: 'Feed', withdrawalType: { @@ -7997,7 +8003,7 @@ Aqui está um *recibo de teste* para mostrar como funciona:`, domainAdmins: 'Administradores de domínio', }, gps: { - tooltip: 'Rastreamento por GPS em andamento! Quando terminar, pare o rastreamento abaixo.', + tooltip: 'Rastreamento de GPS em andamento! Quando terminar, pare o rastreamento abaixo.', disclaimer: 'Use o GPS para criar uma despesa a partir da sua viagem. Toque em Iniciar abaixo para começar o rastreamento.', error: {failedToStart: 'Falha ao iniciar o rastreamento de localização.', failedToGetPermissions: 'Falha ao obter as permissões de localização necessárias.'}, trackingDistance: 'Acompanhando a distância...', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 71c8fc3addb9..a9900d23c8be 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -1451,6 +1451,12 @@ const translations: TranslationDeepObject = { amountTooLargeError: '总金额过大。请减少工时或降低费率。', }, correctDistanceRateError: '修复里程费率错误后请重试。', + markedAsReimbursable: '将该报销单标记为“可报销”', + markedAsNonReimbursable: '将此报销单标记为“不可报销”', + markedAsBillable: '将该报销标记为“可计费”', + markedAsNonBillable: '将此报销标记为“不可向客户计费”', + updatedFieldTo: ({key, value, first}: {key: string; value: string | boolean; first: boolean}) => `将 ${first ? '设置' : ''}${key} 设置为 "${value}"`, + viaWorkspaceRules: ({route}: {route: string}) => `通过工作区规则`, }, transactionMerge: { listPage: { @@ -6699,8 +6705,8 @@ ${reportName} purchaseCurrency: '购买货币', groupBy: { [CONST.SEARCH.GROUP_BY.FROM]: '从', - [CONST.SEARCH.GROUP_BY.CARD]: '卡片', - [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: '提款 ID', + [CONST.SEARCH.GROUP_BY.CARD]: '卡', + [CONST.SEARCH.GROUP_BY.WITHDRAWAL_ID]: '提现 ID', }, feed: '动态', withdrawalType: { From 8e79c3bb987564944056eaa1ecc27bca46211fcd Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Mon, 26 Jan 2026 17:19:56 -0800 Subject: [PATCH 13/23] fix lint and types --- src/languages/pt-BR.ts | 4 ++++ src/types/onyx/OriginalMessage.ts | 13 +++++++++++++ tests/unit/ModifiedExpenseMessageTest.ts | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index dc4545060a15..14953bd89141 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -8029,6 +8029,10 @@ Aqui está um *recibo de teste* para mostrar como funciona:`, domainAdmins: 'Administradores de domínio', }, gps: { + disclaimer: 'Use o GPS para criar uma despesa a partir da sua viagem. Toque em Iniciar abaixo para começar o rastreamento.', + error: {failedToStart: 'Falha ao iniciar o rastreamento de localização.', failedToGetPermissions: 'Falha ao obter as permissões de localização necessárias.'}, + trackingDistance: 'Acompanhando a distância...', + stopped: 'Parado', start: 'Iniciar', stop: 'Parar', discard: 'Descartar', diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index a4a10729a003..c51d3dc0df2b 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -740,12 +740,25 @@ type OriginalMessageModifiedExpense = { }; type PolicyRulesModifiedFields = { + /** The value that the merchant was changed to */ merchant?: string; + + /** The value that the amount was changed to */ category?: string; + + /** The value that the tag was changed to */ tag?: string; + + /** The value that the description was changed to */ description?: string; + + /** The value that the billable status was changed to */ billable?: boolean; + + /** The value that the reimbursable status was changed to */ reimbursable?: boolean; + + /** The value that the tax was changed to */ tax?: Record; }; diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index 4e52805b4ffb..a21956e8c75b 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -822,7 +822,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `set the category to "Travel", merchant to "McDonald\'s", marked the expense as "billable", and marked the expense as "reimbursable" via workspace rules`; + const expectedResult = `set the category to "Travel", merchant to "McDonald's", marked the expense as "billable", and marked the expense as "reimbursable" via workspace rules`; expect(result).toEqual(expectedResult); }); @@ -842,7 +842,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `set the category to "Travel", and merchant to "McDonald\'s" via workspace rules`; + const expectedResult = `set the category to "Travel", and merchant to "McDonald's" via workspace rules`; expect(result).toEqual(expectedResult); }); From 55658211d0a82c4b7caeb755346e50203e56a634 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 08:24:09 -0800 Subject: [PATCH 14/23] add tax rate support --- src/libs/ModifiedExpenseMessage.ts | 20 ++++++++++++++------ src/types/onyx/ExpenseRule.ts | 20 ++++++++++++++++---- src/types/onyx/OriginalMessage.ts | 7 ++++--- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index c99af39144b8..0592d46f6d53 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -6,8 +6,9 @@ import type {LocalizedTranslate} from '@components/LocaleContextProvider'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; -import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import type {Policy, PolicyTagLists, Report, ReportAction, TaxRate} from '@src/types/onyx'; +import {PolicyRuleTaxRate} from '@src/types/onyx/ExpenseRule'; +import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; @@ -202,7 +203,7 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string): string { - const entries = Object.entries(policyRulesModifiedFields) as [keyof PolicyRulesModifiedFields, string | boolean][]; + const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, string | boolean | PolicyRuleTaxRate]>; const fragments = entries.map(([key, value], i) => { const isFirst = i === 0; @@ -215,12 +216,18 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli return value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); } - return translate('iou.updatedFieldTo', {key: translate(`common.${key}`).toLowerCase(), value, first: isFirst}); + if (key === 'tax') { + const taxRate = value as PolicyRuleTaxRate; + return translate('iou.updatedFieldTo', {key: translate('common.tax').toLowerCase(), value: taxRate.name, first: isFirst}); + } + + const updatedValue = value as string | boolean; + return translate('iou.updatedFieldTo', {key: translate(`common.${key}`).toLowerCase(), value: updatedValue, first: isFirst}); }); if (fragments.length > 1) { const lastIndex = fragments.length - 1; - fragments[lastIndex] = `${translate('common.and')} ${fragments[lastIndex]}`; + fragments[lastIndex] = `${translate('common.and')} ${fragments.at(lastIndex)}`; } const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; @@ -498,7 +505,8 @@ function getForReportAction({ const hasPolicyRulesModifiedFields = isReportActionOriginalMessageAnObject && 'policyRulesModifiedFields' in reportActionOriginalMessage && 'policyID' in reportActionOriginalMessage; if (hasPolicyRulesModifiedFields) { - const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; + const rulePolicyID = reportActionOriginalMessage.policyID; + const policyRulesModifiedFields = reportActionOriginalMessage.policyRulesModifiedFields; if (policyRulesModifiedFields && policyID) { // eslint-disable-next-line @typescript-eslint/no-deprecated diff --git a/src/types/onyx/ExpenseRule.ts b/src/types/onyx/ExpenseRule.ts index 7880a17e988e..9d54945fac58 100644 --- a/src/types/onyx/ExpenseRule.ts +++ b/src/types/onyx/ExpenseRule.ts @@ -1,5 +1,5 @@ -/** Model of tax rate */ -type TaxRate = { +/** Model of tax rate on a personal rule */ +type PersonalRuleTaxRate = { /** The tax ID */ externalID: string; @@ -7,6 +7,18 @@ type TaxRate = { value: string; }; +/** Model of tax rate on a policy rule */ +type PolicyRuleTaxRate = { + /** The tax ID */ + externalID: string; + + /** The tax rate */ + value: string; + + /** The name of the tax rate */ + name: string; +}; + /** Model of expense rule */ type ExpenseRule = { /** Whether the transaction is set to be billable */ @@ -37,8 +49,8 @@ type ExpenseRule = { tag?: string; /** The tax rate set by the rule */ - tax?: Record; + tax?: Record; }; -export type {TaxRate}; +export type {PersonalRuleTaxRate, PolicyRuleTaxRate}; export default ExpenseRule; diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index c51d3dc0df2b..302adf1f7295 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1,7 +1,7 @@ import type {ValueOf} from 'type-fest'; import type CONST from '@src/CONST'; import type DeepValueOf from '@src/types/utils/DeepValueOf'; -import {TaxRate} from './ExpenseRule'; +import type {PolicyRuleTaxRate} from './ExpenseRule'; import type {Attendee} from './IOU'; import type {OldDotOriginalMessageMap} from './OldDotAction'; import type {AllConnectionName} from './Policy'; @@ -735,10 +735,11 @@ type OriginalMessageModifiedExpense = { /** The policy ID that the expense was modified in */ policyID?: string; - /** The fields that were modified by policy rules*/ + /** The fields that were modified by policy rules */ policyRulesModifiedFields?: PolicyRulesModifiedFields; }; +/** Policy rules modified fields */ type PolicyRulesModifiedFields = { /** The value that the merchant was changed to */ merchant?: string; @@ -759,7 +760,7 @@ type PolicyRulesModifiedFields = { reimbursable?: boolean; /** The value that the tax was changed to */ - tax?: Record; + tax?: Record; }; /** Model of a `travel update` report action */ From f72fdf80a156bd73b82cbe0a603d26b7f4e0ab1e Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 08:24:38 -0800 Subject: [PATCH 15/23] fix policy ID fields --- src/libs/ModifiedExpenseMessage.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 0592d46f6d53..ad34782e928c 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -6,8 +6,8 @@ import type {LocalizedTranslate} from '@components/LocaleContextProvider'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {Policy, PolicyTagLists, Report, ReportAction, TaxRate} from '@src/types/onyx'; -import {PolicyRuleTaxRate} from '@src/types/onyx/ExpenseRule'; +import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; +import type {PolicyRuleTaxRate} from '@src/types/onyx/ExpenseRule'; import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; @@ -508,9 +508,9 @@ function getForReportAction({ const rulePolicyID = reportActionOriginalMessage.policyID; const policyRulesModifiedFields = reportActionOriginalMessage.policyRulesModifiedFields; - if (policyRulesModifiedFields && policyID) { + if (policyRulesModifiedFields && rulePolicyID) { // eslint-disable-next-line @typescript-eslint/no-deprecated - return getPolicyRulesModifiedFieldsMessage(translateLocal, policyRulesModifiedFields, policyID); + return getPolicyRulesModifiedFieldsMessage(translateLocal, policyRulesModifiedFields, rulePolicyID); } } From 81c6a67726daa25395a4dea65979d1fc48be87d0 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 08:44:55 -0800 Subject: [PATCH 16/23] add tax rate name --- src/libs/ModifiedExpenseMessage.ts | 8 ++++---- src/types/onyx/OriginalMessage.ts | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index ad34782e928c..ac346f79cf65 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -7,7 +7,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; -import type {PolicyRuleTaxRate} from '@src/types/onyx/ExpenseRule'; import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; @@ -203,7 +202,7 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string): string { - const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, string | boolean | PolicyRuleTaxRate]>; + const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; const fragments = entries.map(([key, value], i) => { const isFirst = i === 0; @@ -217,8 +216,9 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli } if (key === 'tax') { - const taxRate = value as PolicyRuleTaxRate; - return translate('iou.updatedFieldTo', {key: translate('common.tax').toLowerCase(), value: taxRate.name, first: isFirst}); + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + return translate('iou.updatedFieldTo', {key: translate('common.tax').toLowerCase(), value: taxRateName, first: isFirst}); } const updatedValue = value as string | boolean; diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 302adf1f7295..4af9e9b8788e 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -760,7 +760,11 @@ type PolicyRulesModifiedFields = { reimbursable?: boolean; /** The value that the tax was changed to */ - tax?: Record; + tax?: { + /** The tax rate being used */ + // eslint-disable-next-line @typescript-eslint/naming-convention + field_id_TAX: PolicyRuleTaxRate; + }; }; /** Model of a `travel update` report action */ From 5b070c653e8e393fa1d27e8e4b88c6f0ee58aa1c Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 08:53:28 -0800 Subject: [PATCH 17/23] add another test for tax rate --- tests/unit/ModifiedExpenseMessageTest.ts | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index a21956e8c75b..e46befa25dd1 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -827,6 +827,32 @@ describe('ModifiedExpenseMessage', () => { expect(result).toEqual(expectedResult); }); + it('returns the correct text message with tax rate overrides', () => { + const reportAction = { + ...createRandomReportAction(1), + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, + originalMessage: { + policyID: '1234', + policyRulesModifiedFields: { + tax: { + // eslint-disable-next-line @typescript-eslint/naming-convention + field_id_TAX: { + externalID: '', + name: 'New Tax Rate', + value: '10', + }, + }, + }, + } as OriginalMessageModifiedExpense, + }; + + const result = getForReportAction({reportAction, policyID: report.policyID}); + + const expectedResult = `set the tax rate to "New Tax Rate" via workspace rules`; + + expect(result).toEqual(expectedResult); + }); + it('returns the correct text message with two overrides', () => { const reportAction = { ...createRandomReportAction(1), From 5f51cb148a9c84a0a348a94e048acd9946daa675 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 08:54:50 -0800 Subject: [PATCH 18/23] update translation --- src/libs/ModifiedExpenseMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index ac346f79cf65..9b6240b96ebe 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -218,7 +218,7 @@ function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, poli if (key === 'tax') { const taxEntry = value as PolicyRulesModifiedFields['tax']; const taxRateName = taxEntry?.field_id_TAX.name ?? ''; - return translate('iou.updatedFieldTo', {key: translate('common.tax').toLowerCase(), value: taxRateName, first: isFirst}); + return translate('iou.updatedFieldTo', {key: translate('workspace.taxes.taxRate').toLowerCase(), value: taxRateName, first: isFirst}); } const updatedValue = value as string | boolean; From bc954ec8c47d0a6ee87e2443c1715c09eb0ea166 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 10:42:44 -0800 Subject: [PATCH 19/23] update how we translate --- src/languages/en.ts | 35 +++++++++++++++++++++++++++ src/languages/es.ts | 35 +++++++++++++++++++++++++++ src/libs/ModifiedExpenseMessage.ts | 38 ++---------------------------- 3 files changed, 72 insertions(+), 36 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b6c0bfa69a94..32ae343addd6 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1,11 +1,14 @@ import {CONST as COMMON_CONST} from 'expensify-common'; import startCase from 'lodash/startCase'; +import type {ValueOf} from 'type-fest'; import type {OnboardingTask} from '@libs/actions/Welcome/OnboardingFlow'; import StringUtils from '@libs/StringUtils'; import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; +import ROUTES from '@src/ROUTES'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import type { ChangeFieldParams, ConnectionNameParams, @@ -1471,6 +1474,38 @@ const translations = { }, correctDistanceRateError: 'Fix the distance rate error and try again.', AskToExplain: `. Explain ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string, environmentURL: string) => { + const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; + + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + + if (key === 'reimbursable') { + return value ? 'marked the expense as "reimbursable"' : 'marked the expense as "non-reimbursable"'; + } + + if (key === 'billable') { + return value ? 'marked the expense as "billable"' : 'marked the expense as "non-billable"'; + } + + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + return `${isFirst ? 'set the ' : ''} tax rate to "${taxRateName}"`; + } + + const updatedValue = value as string | boolean; + return `${isFirst ? 'set the ' : ''} ${translations.common[key]} to "${updatedValue}"`; + }); + + if (fragments.length > 1) { + const lastIndex = fragments.length - 1; + fragments[lastIndex] = `and ${fragments.at(lastIndex)}`; + } + + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; + return `${fragments.join(', ')} via workspace rules`; + }, }, transactionMerge: { listPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 7cd7b0cd8803..dba98a0481b9 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1,6 +1,9 @@ import {CONST as COMMON_CONST} from 'expensify-common'; +import {ValueOf} from 'type-fest'; import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; +import ROUTES from '@src/ROUTES'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import type en from './en'; import type {CreatedReportForUnapprovedTransactionsParams, PaidElsewhereParams, RoutedDueToDEWParams, SplitDateRangeParams, ViolationsRterParams} from './params'; import type {TranslationDeepObject} from './types'; @@ -1216,6 +1219,38 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Corrige el error de la tasa de distancia y vuelve a intentarlo.', AskToExplain: `. Explicar ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string, environmentURL: string) => { + const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; + + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + + if (key === 'reimbursable') { + return value ? 'marcó el gasto como "reembolsable"' : 'marcó el gasto como "no reembolsable"'; + } + + if (key === 'billable') { + return value ? 'marcó el gasto como "facturable"' : 'marcó el gasto como "no facturable"'; + } + + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + return `${isFirst ? 'estableció el ' : ''} tasa de impuesto a "${taxRateName}"`; + } + + const updatedValue = value as string | boolean; + return `${isFirst ? 'estableció el ' : ''} ${translations.common[key]} a "${updatedValue}"`; + }); + + if (fragments.length > 1) { + const lastIndex = fragments.length - 1; + fragments[lastIndex] = `y ${fragments.at(lastIndex)}`; + } + + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; + return `${fragments.join(', ')} a través de reglas del espacio de trabajo`; + }, }, transactionMerge: { listPage: { diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 9b6240b96ebe..45540d2cbad2 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -7,7 +7,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx'; -import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import {getDecodedCategoryName, isCategoryMissing} from './CategoryUtils'; import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; @@ -201,39 +200,6 @@ function getMovedFromOrToReportMessage(translate: LocalizedTranslate, movedFromR } } -function getPolicyRulesModifiedFieldsMessage(translate: LocalizedTranslate, policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string): string { - const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; - - const fragments = entries.map(([key, value], i) => { - const isFirst = i === 0; - - if (key === 'reimbursable') { - return value ? translate('iou.markedAsReimbursable') : translate('iou.markedAsNonReimbursable'); - } - - if (key === 'billable') { - return value ? translate('iou.markedAsBillable') : translate('iou.markedAsNonBillable'); - } - - if (key === 'tax') { - const taxEntry = value as PolicyRulesModifiedFields['tax']; - const taxRateName = taxEntry?.field_id_TAX.name ?? ''; - return translate('iou.updatedFieldTo', {key: translate('workspace.taxes.taxRate').toLowerCase(), value: taxRateName, first: isFirst}); - } - - const updatedValue = value as string | boolean; - return translate('iou.updatedFieldTo', {key: translate(`common.${key}`).toLowerCase(), value: updatedValue, first: isFirst}); - }); - - if (fragments.length > 1) { - const lastIndex = fragments.length - 1; - fragments[lastIndex] = `${translate('common.and')} ${fragments.at(lastIndex)}`; - } - - const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; - return `${fragments.join(', ')} ${translate('iou.viaWorkspaceRules', {route: policyRulesRoute})}`; -} - /** * Get the report action message when expense has been modified. * @@ -510,7 +476,7 @@ function getForReportAction({ if (policyRulesModifiedFields && rulePolicyID) { // eslint-disable-next-line @typescript-eslint/no-deprecated - return getPolicyRulesModifiedFieldsMessage(translateLocal, policyRulesModifiedFields, rulePolicyID); + return translateLocal('iou.policyRulesModifiedFields', policyRulesModifiedFields, rulePolicyID, environmentURL); } } @@ -763,7 +729,7 @@ function getForReportActionTemp({ const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; if (policyRulesModifiedFields && policyID) { - return getPolicyRulesModifiedFieldsMessage(translate, policyRulesModifiedFields, policyID); + return translate('iou.policyRulesModifiedFields', policyRulesModifiedFields, policyID, environmentURL); } } From b72bd6c581080d7ad74061909a2a0fc8e3751fcd Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 11:16:16 -0800 Subject: [PATCH 20/23] update translations --- src/languages/en.ts | 26 ++++++++++++------------ src/languages/es.ts | 4 ++-- src/libs/ModifiedExpenseMessage.ts | 8 +++++--- tests/unit/ModifiedExpenseMessageTest.ts | 4 ++-- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 32ae343addd6..6b420b1219c7 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1,14 +1,13 @@ import {CONST as COMMON_CONST} from 'expensify-common'; import startCase from 'lodash/startCase'; -import type {ValueOf} from 'type-fest'; import type {OnboardingTask} from '@libs/actions/Welcome/OnboardingFlow'; import StringUtils from '@libs/StringUtils'; import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; -import ROUTES from '@src/ROUTES'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type { ChangeFieldParams, ConnectionNameParams, @@ -1474,8 +1473,8 @@ const translations = { }, correctDistanceRateError: 'Fix the distance rate error and try again.', AskToExplain: `. Explain ✨`, - policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string, environmentURL: string) => { - const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); const fragments = entries.map(([key, value], i) => { const isFirst = i === 0; @@ -1491,20 +1490,21 @@ const translations = { if (key === 'tax') { const taxEntry = value as PolicyRulesModifiedFields['tax']; const taxRateName = taxEntry?.field_id_TAX.name ?? ''; - return `${isFirst ? 'set the ' : ''} tax rate to "${taxRateName}"`; + if (isFirst) { + return `set the tax rate to "${taxRateName}"`; + } + return `tax rate to "${taxRateName}"`; } const updatedValue = value as string | boolean; - return `${isFirst ? 'set the ' : ''} ${translations.common[key]} to "${updatedValue}"`; - }); + if (isFirst) { + return `set the ${translations.common[key].toLowerCase()} to "${updatedValue}"`; + } - if (fragments.length > 1) { - const lastIndex = fragments.length - 1; - fragments[lastIndex] = `and ${fragments.at(lastIndex)}`; - } + return `${translations.common[key].toLowerCase()} to "${updatedValue}"`; + }); - const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; - return `${fragments.join(', ')} via workspace rules`; + return `${formatList(fragments)} via workspace rules`; }, }, transactionMerge: { diff --git a/src/languages/es.ts b/src/languages/es.ts index dba98a0481b9..e6ef1f45364d 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1,9 +1,9 @@ import {CONST as COMMON_CONST} from 'expensify-common'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; import type en from './en'; import type {CreatedReportForUnapprovedTransactionsParams, PaidElsewhereParams, RoutedDueToDEWParams, SplitDateRangeParams, ViolationsRterParams} from './params'; import type {TranslationDeepObject} from './types'; diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index 45540d2cbad2..c23c05bbc2b4 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -12,7 +12,7 @@ import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; import {getEnvironmentURL} from './Environment/Environment'; // eslint-disable-next-line @typescript-eslint/no-deprecated -import {translateLocal} from './Localize'; +import {formatList, translateLocal} from './Localize'; import Log from './Log'; import Parser from './Parser'; import {getPersonalDetailByEmail} from './PersonalDetailsUtils'; @@ -475,8 +475,9 @@ function getForReportAction({ const policyRulesModifiedFields = reportActionOriginalMessage.policyRulesModifiedFields; if (policyRulesModifiedFields && rulePolicyID) { + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(rulePolicyID)}`; // eslint-disable-next-line @typescript-eslint/no-deprecated - return translateLocal('iou.policyRulesModifiedFields', policyRulesModifiedFields, rulePolicyID, environmentURL); + return translateLocal('iou.policyRulesModifiedFields', policyRulesModifiedFields, policyRulesRoute, formatList); } } @@ -729,7 +730,8 @@ function getForReportActionTemp({ const {policyRulesModifiedFields, policyID} = reportActionOriginalMessage; if (policyRulesModifiedFields && policyID) { - return translate('iou.policyRulesModifiedFields', policyRulesModifiedFields, policyID, environmentURL); + const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; + return translate('iou.policyRulesModifiedFields', policyRulesModifiedFields, policyRulesRoute, formatList); } } diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index e46befa25dd1..962e2cbe2592 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -868,7 +868,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `set the category to "Travel", and merchant to "McDonald's" via workspace rules`; + const expectedResult = `set the category to "Travel" and merchant to "McDonald's" via workspace rules`; expect(result).toEqual(expectedResult); }); @@ -907,7 +907,7 @@ describe('ModifiedExpenseMessage', () => { const result = getForReportAction({reportAction, policyID: report.policyID}); - const expectedResult = `marked the expense as "reimbursable", and marked the expense as "billable" via workspace rules`; + const expectedResult = `marked the expense as "reimbursable" and marked the expense as "billable" via workspace rules`; expect(result).toEqual(expectedResult); }); From ba1ce20328de77290f3eb528a315f7a928329598 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 11:20:06 -0800 Subject: [PATCH 21/23] update es --- src/languages/es.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index e6ef1f45364d..b9efa90def6f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1,9 +1,8 @@ import {CONST as COMMON_CONST} from 'expensify-common'; -import type {ValueOf} from 'type-fest'; import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; -import ROUTES from '@src/ROUTES'; import type {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type {CreatedReportForUnapprovedTransactionsParams, PaidElsewhereParams, RoutedDueToDEWParams, SplitDateRangeParams, ViolationsRterParams} from './params'; import type {TranslationDeepObject} from './types'; @@ -1219,8 +1218,8 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Corrige el error de la tasa de distancia y vuelve a intentarlo.', AskToExplain: `. Explicar ✨`, - policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyID: string, environmentURL: string) => { - const entries = Object.entries(policyRulesModifiedFields) as Array<[keyof PolicyRulesModifiedFields, ValueOf]>; + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); const fragments = entries.map(([key, value], i) => { const isFirst = i === 0; @@ -1236,20 +1235,21 @@ const translations: TranslationDeepObject = { if (key === 'tax') { const taxEntry = value as PolicyRulesModifiedFields['tax']; const taxRateName = taxEntry?.field_id_TAX.name ?? ''; - return `${isFirst ? 'estableció el ' : ''} tasa de impuesto a "${taxRateName}"`; + if (isFirst) { + return `estableció el tasa de impuesto a "${taxRateName}"`; + } + return `tasa de impuesto a "${taxRateName}"`; } const updatedValue = value as string | boolean; - return `${isFirst ? 'estableció el ' : ''} ${translations.common[key]} a "${updatedValue}"`; - }); + if (isFirst) { + return `estableció el ${translations.common[key].toLowerCase()} a "${updatedValue}"`; + } - if (fragments.length > 1) { - const lastIndex = fragments.length - 1; - fragments[lastIndex] = `y ${fragments.at(lastIndex)}`; - } + return `${translations.common[key].toLowerCase()} a "${updatedValue}"`; + }); - const policyRulesRoute = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policyID)}`; - return `${fragments.join(', ')} a través de reglas del espacio de trabajo`; + return `${formatList(fragments)} a través de reglas del espacio de trabajo`; }, }, transactionMerge: { From 7a6fdd7be16059085bb28e35f865824f7a494009 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 11:22:09 -0800 Subject: [PATCH 22/23] update translation logic to match --- src/languages/de.ts | 32 ++++++++++++++++++++++++++++++-- src/languages/fr.ts | 30 +++++++++++++++++++++++++++++- src/languages/it.ts | 32 ++++++++++++++++++++++++++++++-- src/languages/ja.ts | 32 ++++++++++++++++++++++++++++++-- src/languages/nl.ts | 35 +++++++++++++++++++++++++++++++---- src/languages/pl.ts | 34 +++++++++++++++++++++++++++++++--- src/languages/pt-BR.ts | 34 +++++++++++++++++++++++++++++++--- src/languages/zh-hans.ts | 36 ++++++++++++++++++++++++++++++++---- 8 files changed, 244 insertions(+), 21 deletions(-) diff --git a/src/languages/de.ts b/src/languages/de.ts index eb5af716c681..96e28ce37142 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1487,6 +1489,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Beheben Sie den Fehler beim Entfernungssatz und versuchen Sie es erneut.', AskToExplain: `. Erklären ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'hat die Ausgabe als „erstattungsfähig“ markiert' : 'hat die Ausgabe als „nicht erstattungsfähig“ markiert'; + } + if (key === 'billable') { + return value ? 'hat die Ausgabe als „verrechenbar“ markiert' : 'hat die Ausgabe als „nicht abrechenbar“ markiert'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `Steuersatz auf „${taxRateName}“ festlegen`; + } + return `Steuersatz zu „${taxRateName}“`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `Setzen Sie ${translations.common[key].toLowerCase()} auf „${updatedValue}“`; + } + return `${translations.common[key].toLowerCase()} zu "${updatedValue}"`; + }); + return `${formatList(fragments)} über Workspace-Regeln`; + }, }, transactionMerge: { listPage: { @@ -4908,9 +4936,9 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: 'Aufhebung der Kartenzuweisung fehlgeschlagen.', error: { - workspaceFeedsCouldNotBeLoadedTitle: 'Kartenfeeds konnten nicht geladen werden', + workspaceFeedsCouldNotBeLoadedTitle: 'Kartendaten konnten nicht geladen werden', workspaceFeedsCouldNotBeLoadedMessage: - 'Beim Laden der Workspace-Kartenfeeds ist ein Fehler aufgetreten. Bitte versuche es erneut oder wende dich an deine Administratorin bzw. deinen Administrator.', + 'Beim Laden der Feed-Karten des Arbeitsbereichs ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut oder wenden Sie sich an Ihre Administratorin bzw. Ihren Administrator.', feedCouldNotBeLoadedTitle: 'Dieser Feed konnte nicht geladen werden', feedCouldNotBeLoadedMessage: 'Beim Laden dieses Feeds ist ein Fehler aufgetreten. Bitte versuche es erneut oder kontaktiere deine Administratorin/deinen Administrator.', tryAgain: 'Erneut versuchen', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index d8a12569ae8f..ed07fcf7deaa 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1490,6 +1492,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Corrigez l’erreur de taux de distance et réessayez.', AskToExplain: `. Expliquer ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'a marqué la dépense comme « remboursable »' : 'a marqué la dépense comme « non remboursable »'; + } + if (key === 'billable') { + return value ? 'a marqué la dépense comme « facturable »' : 'a marqué la dépense comme « non refacturable »'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `définir le taux de taxe sur « ${taxRateName} »`; + } + return `taux de taxe vers « ${taxRateName} »`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `définir ${translations.common[key].toLowerCase()} sur « ${updatedValue} »`; + } + return `${translations.common[key].toLowerCase()} à « ${updatedValue} »`; + }); + return `${formatList(fragments)} via les règles de l’espace de travail`; + }, }, transactionMerge: { listPage: { @@ -4914,7 +4942,7 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST. cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: 'Échec de la désaffectation de la carte.', error: { - workspaceFeedsCouldNotBeLoadedTitle: 'Impossible de charger les flux de carte', + workspaceFeedsCouldNotBeLoadedTitle: 'Impossible de charger les flux de cartes', workspaceFeedsCouldNotBeLoadedMessage: 'Une erreur s’est produite lors du chargement des flux de cartes de l’espace de travail. Veuillez réessayer ou contacter votre administrateur.', feedCouldNotBeLoadedTitle: 'Impossible de charger ce flux', diff --git a/src/languages/it.ts b/src/languages/it.ts index c657ec51b5b5..03b49e20c68b 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1484,6 +1486,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: "Correggi l'errore nella tariffa della distanza e riprova.", AskToExplain: `. Spiega ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'ha contrassegnato la spesa come "rimborsabile"' : 'ha contrassegnato la spesa come "non rimborsabile"'; + } + if (key === 'billable') { + return value ? 'ha contrassegnato la spesa come "fatturabile"' : 'ha contrassegnato la spesa come "non addebitabile"'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `imposta l'aliquota fiscale su "${taxRateName}"`; + } + return `aliquota fiscale in "${taxRateName}"`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `imposta ${translations.common[key].toLowerCase()} su "${updatedValue}"`; + } + return `${translations.common[key].toLowerCase()} a "${updatedValue}"`; + }); + return `${formatList(fragments)} tramite regole dello spazio di lavoro`; + }, }, transactionMerge: { listPage: { @@ -4896,9 +4924,9 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST. error: { workspaceFeedsCouldNotBeLoadedTitle: 'Impossibile caricare i feed delle carte', workspaceFeedsCouldNotBeLoadedMessage: - 'Si è verificato un errore durante il caricamento dei feed della scheda dell’area di lavoro. Riprova o contatta il tuo amministratore.', + 'Si è verificato un errore durante il caricamento dei feed delle schede dell’area di lavoro. Riprova o contatta il tuo amministratore.', feedCouldNotBeLoadedTitle: 'Impossibile caricare questo feed', - feedCouldNotBeLoadedMessage: 'Si è verificato un errore durante il caricamento di questo feed. Riprova o contatta il tuo amministratore.', + feedCouldNotBeLoadedMessage: 'Si è verificato un errore durante il caricamento di questo feed. Riprova oppure contatta il tuo amministratore.', tryAgain: 'Riprova', }, }, diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 5785b79dcf5a..5e5d95a05eda 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1482,6 +1484,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: '距離レートのエラーを修正して、もう一度お試しください。', AskToExplain: `. 説明する ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? '経費を「立替精算対象」にマークしました' : '経費を「非精算」としてマークしました'; + } + if (key === 'billable') { + return value ? '経費を「請求可能」とマークしました' : '経費を「請求対象外」としてマークしました'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `税率を「${taxRateName}」に設定`; + } + return `税率を「${taxRateName}」に`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `${translations.common[key].toLowerCase()} を「${updatedValue}」に設定`; + } + return `${translations.common[key].toLowerCase()} を「${updatedValue}」に`; + }); + return `${formatList(fragments)}(ワークスペースルール経由)`; + }, }, transactionMerge: { listPage: { @@ -4868,9 +4896,9 @@ _より詳しい手順については、[ヘルプサイトをご覧ください unassignCardFailedError: 'カードの割り当て解除に失敗しました。', error: { workspaceFeedsCouldNotBeLoadedTitle: 'カードフィードを読み込めませんでした', - workspaceFeedsCouldNotBeLoadedMessage: 'ワークスペースのカードフィードを読み込む際にエラーが発生しました。もう一度お試しいただくか、管理者に連絡してください。', + workspaceFeedsCouldNotBeLoadedMessage: 'ワークスペースカードフィードの読み込み中にエラーが発生しました。もう一度お試しいただくか、管理者に連絡してください。', feedCouldNotBeLoadedTitle: 'このフィードを読み込めませんでした', - feedCouldNotBeLoadedMessage: 'このフィードの読み込み中にエラーが発生しました。もう一度お試しいただくか、管理者に連絡してください。', + feedCouldNotBeLoadedMessage: 'このフィードの読み込み中にエラーが発生しました。もう一度お試しいただくか、管理者にお問い合わせください。', tryAgain: '再試行', }, }, diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 8d36ee42ab45..e61d34759241 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1483,6 +1485,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Los het foutieve kilometertarief op en probeer het opnieuw.', AskToExplain: `. Uitleggen ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'heeft de uitgave als „vergoedbaar” gemarkeerd' : 'markeerde de uitgave als ‘niet-terugbetaalbaar’'; + } + if (key === 'billable') { + return value ? 'heeft de uitgave gemarkeerd als ‘factureerbaar’' : 'heeft de uitgave als ‘niet-declarabel’ gemarkeerd'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `stel het belastingtarief in op "${taxRateName}"`; + } + return `belastingtarief naar "${taxRateName}"`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `stel de ${translations.common[key].toLowerCase()} in op "${updatedValue}"`; + } + return `${translations.common[key].toLowerCase()} naar "${updatedValue}"`; + }); + return `${formatList(fragments)} via werkruimteregels`; + }, }, transactionMerge: { listPage: { @@ -4890,10 +4918,9 @@ _Voor gedetailleerdere instructies, [bezoek onze helpsite](${CONST.NETSUITE_IMPO cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: 'Kaartontkoppeling mislukt.', error: { - workspaceFeedsCouldNotBeLoadedTitle: 'Kan kaartfeeds niet laden', - workspaceFeedsCouldNotBeLoadedMessage: - 'Er is een fout opgetreden bij het laden van de kaartfeeds van de werkruimte. Probeer het opnieuw of neem contact op met uw beheerder.', - feedCouldNotBeLoadedTitle: 'Kon deze feed niet laden', + workspaceFeedsCouldNotBeLoadedTitle: 'Kon kaartfeeds niet laden', + workspaceFeedsCouldNotBeLoadedMessage: 'Er is een fout opgetreden bij het laden van werkruimtekaartfeeds. Probeer het opnieuw of neem contact op met uw beheerder.', + feedCouldNotBeLoadedTitle: 'Kan deze feed niet laden', feedCouldNotBeLoadedMessage: 'Er is een fout opgetreden bij het laden van deze feed. Probeer het opnieuw of neem contact op met uw beheerder.', tryAgain: 'Opnieuw proberen', }, diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 4254a4f8c3e4..c56d9fb300b3 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1482,6 +1484,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Napraw błąd stawki za dystans i spróbuj ponownie.', AskToExplain: `. Wyjaśnij ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'oznaczył wydatek jako „podlegający zwrotowi”' : 'oznaczył wydatek jako „niepodlegający zwrotowi”'; + } + if (key === 'billable') { + return value ? 'oznaczył wydatek jako „refakturowalny”' : 'oznaczył wydatek jako „niepodlegający refakturowaniu”'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `ustaw stawkę podatku na „${taxRateName}”`; + } + return `stawka podatku na „${taxRateName}”`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `ustaw ${translations.common[key].toLowerCase()} na „${updatedValue}”`; + } + return `${translations.common[key].toLowerCase()} na „${updatedValue}”`; + }); + return `${formatList(fragments)} przez zasady przestrzeni roboczej`; + }, }, transactionMerge: { listPage: { @@ -4879,10 +4907,10 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: 'Nie udało się odłączyć karty.', error: { - workspaceFeedsCouldNotBeLoadedTitle: 'Nie można było wczytać kanałów kart', + workspaceFeedsCouldNotBeLoadedTitle: 'Nie można załadować kanałów kart', workspaceFeedsCouldNotBeLoadedMessage: 'Wystąpił błąd podczas ładowania kanałów kart w przestrzeni roboczej. Spróbuj ponownie lub skontaktuj się z administratorem.', - feedCouldNotBeLoadedTitle: 'Nie można było wczytać tego kanału', - feedCouldNotBeLoadedMessage: 'Wystąpił błąd podczas ładowania tego kanału. Spróbuj ponownie lub skontaktuj się ze swoim administratorem.', + feedCouldNotBeLoadedTitle: 'Nie udało się wczytać tego kanału', + feedCouldNotBeLoadedMessage: 'Wystąpił błąd podczas ładowania tego kanału. Spróbuj ponownie lub skontaktuj się z administratorem.', tryAgain: 'Spróbuj ponownie', }, }, diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 73c0354046a6..ed37231c4ca7 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1480,6 +1482,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: 'Corrija o erro na taxa de distância e tente novamente.', AskToExplain: `. Explicar ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? 'marcou a despesa como "reembolsável"' : 'marcou a despesa como “não reembolsável”'; + } + if (key === 'billable') { + return value ? 'marcou a despesa como “faturável”' : 'marcou a despesa como "não faturável"'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `definir a taxa de imposto como "${taxRateName}"`; + } + return `alíquota de imposto para "${taxRateName}"`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `defina o ${translations.common[key].toLowerCase()} como "${updatedValue}"`; + } + return `${translations.common[key].toLowerCase()} para "${updatedValue}"`; + }); + return `${formatList(fragments)} via regras do workspace`; + }, }, transactionMerge: { listPage: { @@ -4879,10 +4907,10 @@ _Para instruções mais detalhadas, [visite nosso site de ajuda](${CONST.NETSUIT cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: 'Falha ao desatribuir o cartão.', error: { - workspaceFeedsCouldNotBeLoadedTitle: 'Não foi possível carregar os feeds do cartão', - workspaceFeedsCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar os feeds de cartões do workspace. Tente novamente ou entre em contato com o administrador.', + workspaceFeedsCouldNotBeLoadedTitle: 'Não foi possível carregar os feeds de cartão', + workspaceFeedsCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar os feeds de cartões do workspace. Tente novamente ou entre em contato com o seu administrador.', feedCouldNotBeLoadedTitle: 'Não foi possível carregar este feed', - feedCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar este feed. Tente novamente ou entre em contato com o seu administrador.', + feedCouldNotBeLoadedMessage: 'Ocorreu um erro ao carregar este feed. Tente novamente ou contate o seu administrador.', tryAgain: 'Tentar novamente', }, }, diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 3dda4ab0eb04..608bbc784c5e 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -17,6 +17,8 @@ import dedent from '@libs/StringUtils/dedent'; import CONST from '@src/CONST'; import type {Country} from '@src/CONST'; import type OriginalMessage from '@src/types/onyx/OriginalMessage'; +import {PolicyRulesModifiedFields} from '@src/types/onyx/OriginalMessage'; +import ObjectUtils from '@src/types/utils/ObjectUtils'; import type en from './en'; import type { ChangeFieldParams, @@ -1459,6 +1461,32 @@ const translations: TranslationDeepObject = { }, correctDistanceRateError: '修复里程费率错误后请重试。', AskToExplain: `. 解释 ✨`, + policyRulesModifiedFields: (policyRulesModifiedFields: PolicyRulesModifiedFields, policyRulesRoute: string, formatList: (list: string[]) => string) => { + const entries = ObjectUtils.typedEntries(policyRulesModifiedFields); + const fragments = entries.map(([key, value], i) => { + const isFirst = i === 0; + if (key === 'reimbursable') { + return value ? '将该报销单标记为“可报销”' : '将该报销单标记为“不可报销”'; + } + if (key === 'billable') { + return value ? '将该报销标记为“可向客户收费”' : '已将该报销标记为“不可计费”'; + } + if (key === 'tax') { + const taxEntry = value as PolicyRulesModifiedFields['tax']; + const taxRateName = taxEntry?.field_id_TAX.name ?? ''; + if (isFirst) { + return `将税率设置为“${taxRateName}”`; + } + return `税率为“${taxRateName}”`; + } + const updatedValue = value as string | boolean; + if (isFirst) { + return `将 ${translations.common[key].toLowerCase()} 设置为 “${updatedValue}”`; + } + return `${translations.common[key].toLowerCase()} 为 “${updatedValue}”`; + }); + return `${formatList(fragments)} 通过工作区规则`; + }, }, transactionMerge: { listPage: { @@ -4788,10 +4816,10 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM cardAlreadyAssignedError: 'This card is already assigned to a user in another workspace.', unassignCardFailedError: '卡片取消分配失败。', error: { - workspaceFeedsCouldNotBeLoadedTitle: '无法加载卡片信息流', - workspaceFeedsCouldNotBeLoadedMessage: '加载工作区卡片动态时出错。请重试或联系您的管理员。', - feedCouldNotBeLoadedTitle: '无法加载此订阅内容', - feedCouldNotBeLoadedMessage: '加载此信息流时出错。请重试或联系您的管理员。', + workspaceFeedsCouldNotBeLoadedTitle: '无法加载银行卡信息', + workspaceFeedsCouldNotBeLoadedMessage: '加载工作区卡片信息流时出错。请重试或联系您的管理员。', + feedCouldNotBeLoadedTitle: '无法加载此订阅', + feedCouldNotBeLoadedMessage: '加载此订阅源时发生错误。请重试或联系您的管理员。', tryAgain: '重试', }, }, From 6b3d34929a748874eeb4ba7f077ea5da39230ae1 Mon Sep 17 00:00:00 2001 From: Jack Senyitko Date: Tue, 27 Jan 2026 13:22:57 -0800 Subject: [PATCH 23/23] update spanish translation --- src/languages/es.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index cf843250f623..38d5ce66965a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1236,7 +1236,7 @@ const translations: TranslationDeepObject = { const taxEntry = value as PolicyRulesModifiedFields['tax']; const taxRateName = taxEntry?.field_id_TAX.name ?? ''; if (isFirst) { - return `estableció el tasa de impuesto a "${taxRateName}"`; + return `estableció la tasa de impuesto a "${taxRateName}"`; } return `tasa de impuesto a "${taxRateName}"`; }