Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ import {
isTripRoom as isTripRoomReportUtils,
isWaitingForSubmissionFromCurrentUser as isWaitingForSubmissionFromCurrentUserReportUtils,
} from '@libs/ReportUtils';
import {
getMerchant,
hasPendingUI,
isCardTransaction,
isPartialMerchant,
isPending,
isReceiptBeingScanned,
shouldShowBrokenConnectionViolationForMultipleTransactions,
} from '@libs/TransactionUtils';
import {getMerchant, hasPendingUI, isCardTransaction, isPartialMerchant, isPending, shouldShowBrokenConnectionViolationForMultipleTransactions} from '@libs/TransactionUtils';
import colors from '@styles/theme/colors';
import variables from '@styles/variables';
import {approveMoneyRequest, canApproveIOU, canIOUBePaid as canIOUBePaidIOUActions, canSubmitReport, payInvoice, payMoneyRequest, submitReport} from '@userActions/IOU';
Expand Down Expand Up @@ -181,7 +173,6 @@ function MoneyRequestReportPreviewContent({
const canAllowSettlement = hasUpdatedTotal(iouReport, policy);
const numberOfRequests = transactions?.length ?? 0;
const transactionsWithReceipts = getTransactionsWithReceipts(iouReportID);
const numberOfScanningReceipts = transactionsWithReceipts.filter((transaction) => isReceiptBeingScanned(transaction)).length;
const numberOfPendingRequests = transactionsWithReceipts.filter((transaction) => isPending(transaction) && isCardTransaction(transaction)).length;

const hasReceipts = transactionsWithReceipts.length > 0;
Expand Down Expand Up @@ -334,12 +325,10 @@ function MoneyRequestReportPreviewContent({
}
return {
supportText: translate('iou.expenseCount', {
scanningReceipts: numberOfScanningReceipts,
pendingReceipts: numberOfPendingRequests,
count: numberOfRequests,
}),
};
}, [translate, numberOfRequests, numberOfScanningReceipts, numberOfPendingRequests]);
}, [translate, numberOfRequests]);

/*
* Manual export
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function ReportPreview({
};
}
return {
supportText: translate('iou.expenseCount', {
supportText: translate('iou.expenseCountWithStatus', {
scanningReceipts: numberOfScanningReceipts,
pendingReceipts: numberOfPendingRequests,
count: numberOfRequests,
Expand Down
9 changes: 8 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,8 @@ const translations = {
yourCompanyWebsiteNote: "If you don't have a website, you can provide your company's LinkedIn or social media profile instead.",
invalidDomainError: 'You have entered an invalid domain. To continue, please enter a valid domain.',
publicDomainError: 'You have entered a public domain. To continue, please enter a private domain.',
expenseCount: ({scanningReceipts = 0, pendingReceipts = 0}: RequestCountParams) => {
Comment thread
nkdengineer marked this conversation as resolved.
// TODO: This key should be deprecated. More details: https://github.com/Expensify/App/pull/59653#discussion_r2028653252
expenseCountWithStatus: ({scanningReceipts = 0, pendingReceipts = 0}: RequestCountParams) => {
const statusText: string[] = [];
if (scanningReceipts > 0) {
statusText.push(`${scanningReceipts} scanning`);
Expand All @@ -965,6 +966,12 @@ const translations = {
other: (count: number) => (statusText.length > 0 ? `${count} expenses (${statusText.join(', ')})` : `${count} expenses`),
};
},
expenseCount: () => {
return {
one: '1 expense',
other: (count: number) => `${count} expenses`,
};
},
deleteExpense: () => ({
one: 'Delete expense',
other: 'Delete expenses',
Expand Down
9 changes: 8 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ const translations = {
yourCompanyWebsiteNote: 'Si no tiene un sitio web, puede proporcionar el perfil de LinkedIn o de las redes sociales de su empresa.',
invalidDomainError: 'Ha introducido un dominio no válido. Para continuar, introduzca un dominio válido.',
publicDomainError: 'Ha introducido un dominio público. Para continuar, introduzca un dominio privado.',
expenseCount: ({scanningReceipts = 0, pendingReceipts = 0}: RequestCountParams) => {
// TODO: This key should be deprecated. More details: https://github.com/Expensify/App/pull/59653#discussion_r2028653252
expenseCountWithStatus: ({scanningReceipts = 0, pendingReceipts = 0}: RequestCountParams) => {
const statusText: string[] = [];
if (scanningReceipts > 0) {
statusText.push(`${scanningReceipts} escaneando`);
Expand All @@ -960,6 +961,12 @@ const translations = {
other: (count: number) => (statusText.length > 0 ? `${count} gastos (${statusText.join(', ')})` : `${count} gastos`),
};
},
expenseCount: () => {
return {
one: '1 gasto',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

did you verify these translations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No need to reconfirm, it's used in here:

one: statusText.length > 0 ? `1 gasto (${statusText.join(', ')})` : `1 gasto`,

other: (count: number) => `${count} gastos`,
};
},
deleteExpense: () => ({
one: 'Eliminar gasto',
other: 'Eliminar gastos',
Expand Down