Skip to content

Adjust copy for various report actions #60171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 21, 2025
3 changes: 2 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,9 @@ const CONST = {
COMPANY_CARDS_CONNECT_CREDIT_CARDS_HELP_URL: 'https://help.expensify.com/new-expensify/hubs/connect-credit-cards/',
CUSTOM_REPORT_NAME_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/spending-insights/Custom-Templates',
CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings',
CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL: 'https://help.expensify.com/articles/new-expensify/workspaces/Set-up-rules#configure-expense-report-rules',
SELECT_WORKFLOWS_HELP_URL: 'https://help.expensify.com/articles/new-expensify/workspaces/Set-up-workflows#select-workflows',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think DELAYED_SUBMISSION_HELP_URL will be unused after declaring this, let's remove it if it is unused.

COPILOT_HELP_URL: 'https://help.expensify.com/articles/new-expensify/settings/Add-or-Act-As-a-Copilot',
DELAYED_SUBMISSION_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/reports/Automatically-submit-employee-reports',
ENCRYPTION_AND_SECURITY_HELP_URL: 'https://help.expensify.com/articles/new-expensify/settings/Encryption-and-Data-Security',
PLAN_TYPES_AND_PRICING_HELP_URL: 'https://help.expensify.com/articles/new-expensify/billing-and-subscriptions/Plan-types-and-pricing',
MERGE_ACCOUNT_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/settings/Merge-accounts',
Expand Down
23 changes: 11 additions & 12 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ const translations = {
submitAmount: ({amount}: RequestAmountParams) => `Submit ${amount}`,
submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `submitted ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
automaticallySubmittedAmount: ({formattedAmount}: RequestedAmountMessageParams) =>
`automatically submitted ${formattedAmount} via <a href="${CONST.DELAYED_SUBMISSION_HELP_URL}">delayed submission</a>`,
`submitted ${formattedAmount} via <a href="${CONST.SELECT_WORKFLOWS_HELP_URL}">delay submissions</a>`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `split ${amount}`,
didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `split ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
Expand All @@ -1018,12 +1018,10 @@ const translations = {
managerApprovedAmount: ({manager, amount}: ManagerApprovedAmountParams) => `${manager} approved ${amount}`,
payerSettled: ({amount}: PayerSettledParams) => `paid ${amount}`,
payerSettledWithMissingBankAccount: ({amount}: PayerSettledParams) => `paid ${amount}. Add a bank account to receive your payment.`,
automaticallyApprovedAmount: ({amount}: ApprovedAmountParams) =>
`automatically approved ${amount} via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
automaticallyApprovedAmount: ({amount}: ApprovedAmountParams) => `approved ${amount} via <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">workspace rules</a>`,
approvedAmount: ({amount}: ApprovedAmountParams) => `approved ${amount}`,
unapprovedAmount: ({amount}: UnapprovedParams) => `unapproved ${amount}`,
automaticallyForwardedAmount: ({amount}: ForwardedAmountParams) =>
`automatically approved ${amount} via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
automaticallyForwardedAmount: ({amount}: ForwardedAmountParams) => `approved ${amount} via <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">workspace rules</a>`,
forwardedAmount: ({amount}: ForwardedAmountParams) => `approved ${amount}`,
rejectedThisReport: 'rejected this report',
waitingOnBankAccount: ({submitterDisplayName}: WaitingOnBankAccountParams) => `started settling up. Payment is on hold until ${submitterDisplayName} adds a bank account.`,
Expand All @@ -1035,7 +1033,7 @@ const translations = {
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} elsewhere`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}paid ${amount} with Expensify`,
automaticallyPaidWithExpensify: ({payer, amount}: PaidWithExpensifyWithAmountParams) =>
`${payer ? `${payer} ` : ''}automatically paid ${amount} with Expensify via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
`${payer ? `${payer} ` : ''}paid ${amount} with Expensify via <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">workspace rules</a>`,
noReimbursableExpenses: 'This report has an invalid amount',
pendingConversionMessage: "Total will update when you're back online",
changedTheExpense: 'changed the expense',
Expand Down Expand Up @@ -5287,14 +5285,15 @@ const translations = {
`changed the workspace to ${toPolicyName}${fromPolicyName ? ` (previously ${fromPolicyName})` : ''}`,
changeType: ({oldType, newType}: ChangeTypeParams) => `changed type from ${oldType} to ${newType}`,
delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `sent this report to ${delegateUser} since ${originalManager} is on vacation`,
exportedToCSV: `exported this report to CSV`,
exportedToCSV: `exported to CSV`,
exportedToIntegration: {
automatic: ({label}: ExportedToIntegrationParams) => `exported this report to ${label}.`,
automaticActionOne: ({label}: ExportedToIntegrationParams) => `automatically exported this report to ${label} via`,
automaticActionTwo: 'accounting settings.',
automatic: ({label}: ExportedToIntegrationParams) => `exported to ${label}`,
automaticActionOne: ({label}: ExportedToIntegrationParams) => `exported to ${label} via`,
automaticActionTwo: 'accounting settings',
manual: ({label}: ExportedToIntegrationParams) => `marked this report as manually exported to ${label}.`,
reimburseableLink: 'View out-of-pocket expenses.',
nonReimbursableLink: 'View company card expenses.',
automaticActionThree: 'and successfully created a record for',
reimburseableLink: 'out-of-pocket expenses',
nonReimbursableLink: 'company card expenses.',
pending: ({label}: ExportedToIntegrationParams) => `started exporting this report to ${label}...`,
},
integrationsMessage: ({errorMessage, label, linkText, linkURL}: IntegrationSyncFailedParams) =>
Expand Down
21 changes: 11 additions & 10 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ const translations = {
submitAmount: ({amount}: RequestAmountParams) => `Solicitar ${amount}`,
submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `solicitó ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
automaticallySubmittedAmount: ({formattedAmount}: RequestedAmountMessageParams) =>
`se enviaron automáticamente ${formattedAmount} mediante <a href="${CONST.DELAYED_SUBMISSION_HELP_URL}">envío diferido</a>`,
`envió ${formattedAmount} mediante <a href="${CONST.SELECT_WORKFLOWS_HELP_URL}">envíos diferidos</a>`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `dividir ${amount}`,
didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `dividió ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
Expand All @@ -1014,11 +1014,11 @@ const translations = {
payerSettled: ({amount}: PayerSettledParams) => `pagó ${amount}`,
payerSettledWithMissingBankAccount: ({amount}: PayerSettledParams) => `pagó ${amount}. Agrega una cuenta bancaria para recibir tu pago.`,
automaticallyApprovedAmount: ({amount}: ApprovedAmountParams) =>
`aprobado automáticamente ${amount} según las <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">reglas del espacio de trabajo</a>`,
`aprobó ${amount} según las <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">reglas del espacio de trabajo</a>`,
approvedAmount: ({amount}: ApprovedAmountParams) => `aprobó ${amount}`,
unapprovedAmount: ({amount}: UnapprovedParams) => `desaprobó ${amount}`,
automaticallyForwardedAmount: ({amount}: ForwardedAmountParams) =>
`aprobado automáticamente ${amount} según las <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">reglas del espacio de trabajo</a>`,
`aprobó ${amount} según las <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">reglas del espacio de trabajo</a>`,
forwardedAmount: ({amount}: ForwardedAmountParams) => `aprobó ${amount}`,
rejectedThisReport: 'rechazó este informe',
waitingOnBankAccount: ({submitterDisplayName}: WaitingOnBankAccountParams) => `inició el pago, pero no se procesará hasta que ${submitterDisplayName} añada una cuenta bancaria`,
Expand All @@ -1030,7 +1030,7 @@ const translations = {
paidElsewhereWithAmount: ({payer, amount}: PaidElsewhereWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} de otra forma`,
paidWithExpensifyWithAmount: ({payer, amount}: PaidWithExpensifyWithAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount} con Expensify`,
automaticallyPaidWithExpensify: ({payer, amount}: PaidWithExpensifyWithAmountParams) =>
`${payer ? `${payer} ` : ''}auto-pagó ${amount} con Expensify via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">reglas del espacio de trabajo</a>`,
`${payer ? `${payer} ` : ''}pagó ${amount} con Expensify via <a href="${CONST.CONFIGURE_EXPENSE_REPORT_RULES_HELP_URL}">reglas del espacio de trabajo</a>`,
noReimbursableExpenses: 'El importe de este informe no es válido',
pendingConversionMessage: 'El total se actualizará cuando estés online',
changedTheExpense: 'cambió el gasto',
Expand Down Expand Up @@ -5341,14 +5341,15 @@ const translations = {
`cambió el espacio de trabajo a ${toPolicyName}${fromPolicyName ? ` (previamente ${fromPolicyName})` : ''}`,
changeType: ({oldType, newType}: ChangeTypeParams) => `cambió type de ${oldType} a ${newType}`,
delegateSubmit: ({delegateUser, originalManager}: DelegateSubmitParams) => `envié este informe a ${delegateUser} ya que ${originalManager} está de vacaciones`,
exportedToCSV: `exportó este informe a CSV`,
exportedToCSV: `exportado a CSV`,
exportedToIntegration: {
automatic: ({label}: ExportedToIntegrationParams) => `exportó este informe a ${label}.`,
automaticActionOne: ({label}: ExportedToIntegrationParams) => `exportó automáticamente este informe a ${label} a través de la`,
automaticActionTwo: 'configuración contable.',
automatic: ({label}: ExportedToIntegrationParams) => `exportado a ${label}`,
automaticActionOne: ({label}: ExportedToIntegrationParams) => `exportado a ${label} mediante`,
automaticActionTwo: 'configuración contable',
manual: ({label}: ExportedToIntegrationParams) => `marcó este informe como exportado manualmente a ${label}.`,
reimburseableLink: 'Ver los gastos por cuenta propia.',
nonReimbursableLink: 'Ver los gastos de la tarjeta de empresa.',
automaticActionThree: 'y creó correctamente un registro para',
reimburseableLink: 'gastos por cuenta propia',
nonReimbursableLink: 'gastos de la tarjeta de empresa.',
pending: ({label}: ExportedToIntegrationParams) => `comenzó a exportar este informe a ${label}...`,
},
integrationsMessage: ({label, errorMessage, linkText, linkURL}: IntegrationSyncFailedParams) =>
Expand Down
17 changes: 14 additions & 3 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1795,14 +1795,25 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry<ReportActio
url: '',
});
}

if (reimbursableUrls.length || nonReimbursableUrls.length) {
result.push({
text: translateLocal('report.actions.type.exportedToIntegration.automaticActionThree'),
url: '',
});
}
if (reimbursableUrls.length === 1) {
const shouldAddPeriod = nonReimbursableUrls.length === 0;
result.push({
text: translateLocal('report.actions.type.exportedToIntegration.reimburseableLink'),
text: translateLocal('report.actions.type.exportedToIntegration.reimburseableLink') + (shouldAddPeriod ? '.' : ''),
url: reimbursableUrls.at(0) ?? '',
});
}

if (reimbursableUrls.length === 1 && nonReimbursableUrls.length) {
result.push({
text: translateLocal('common.and'),
url: '',
});
}
if (nonReimbursableUrls.length) {
const text = translateLocal('report.actions.type.exportedToIntegration.nonReimbursableLink');
let url = '';
Expand Down