Skip to content

Commit

Permalink
Merge pull request #36851 from Expensify/monil-fixHOLDTranslate
Browse files Browse the repository at this point in the history
[CP Staging] Handle translations in hold money request workflow
  • Loading branch information
bondydaa authored Feb 20, 2024
2 parents eb26916 + b336cd3 commit 292605f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import type {
FormattedMaxLengthParams,
GoBackMessageParams,
GoToRoomParams,
HeldRequestParams,
InstantSummaryParams,
LocalTimeParams,
LoggedInAsParams,
Expand Down Expand Up @@ -666,8 +667,10 @@ export default {
waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Started settling up, payment is held until ${submitterDisplayName} enables their Wallet`,
enableWallet: 'Enable Wallet',
hold: 'Hold',
holdRequest: 'Hold Request',
unholdRequest: 'Unhold Request',
holdRequest: 'Hold request',
unholdRequest: 'Unhold request',
heldRequest: ({comment}: HeldRequestParams) => `held this request with the comment: ${comment}`,
unheldRequest: 'unheld this request',
explainHold: "Explain why you're holding this request.",
reason: 'Reason',
holdReasonRequired: 'A reason is required when holding.',
Expand Down
7 changes: 5 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import type {
FormattedMaxLengthParams,
GoBackMessageParams,
GoToRoomParams,
HeldRequestParams,
InstantSummaryParams,
LocalTimeParams,
LoggedInAsParams,
Expand Down Expand Up @@ -660,8 +661,10 @@ export default {
},
waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Inició el pago, pero no se procesará hasta que ${submitterDisplayName} active su Billetera`,
enableWallet: 'Habilitar Billetera',
holdRequest: 'Bloquear solicitud de dinero',
unholdRequest: 'Desbloquear solicitud de dinero',
holdRequest: 'Bloquear solicitud',
unholdRequest: 'Desbloquear solicitud',
heldRequest: ({comment}: HeldRequestParams) => `bloqueó esta solicitud con el comentario: ${comment}`,
unheldRequest: 'desbloqueó esta solicitud',
explainHold: 'Explica la razón para bloquear esta solicitud.',
reason: 'Razón',
holdReasonRequired: 'Se requiere una razón para bloquear.',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ type ElectronicFundsParams = {percentage: string; amount: string};

type LogSizeParams = {size: number};

type HeldRequestParams = {comment: string};

export type {
AdminCanceledRequestParams,
ApprovedAmountParams,
Expand Down Expand Up @@ -395,4 +397,5 @@ export type {
WelcomeToRoomParams,
ZipCodeExampleFormatParams,
LogSizeParams,
HeldRequestParams,
};
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ function buildOptimisticHoldReportAction(comment: string, created = DateUtils.ge
{
type: CONST.REPORT.MESSAGE.TYPE.TEXT,
style: 'normal',
text: `held this money request with the comment: ${comment}`,
text: Localize.translateLocal('iou.heldRequest', {comment}),
},
{
type: CONST.REPORT.MESSAGE.TYPE.COMMENT,
Expand Down Expand Up @@ -3564,7 +3564,7 @@ function buildOptimisticUnHoldReportAction(created = DateUtils.getDBTime()): Opt
{
type: CONST.REPORT.MESSAGE.TYPE.TEXT,
style: 'normal',
text: `unheld this money request`,
text: Localize.translateLocal('iou.unheldRequest'),
},
],
person: [
Expand Down
4 changes: 4 additions & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ function ReportActionItem(props) {
children = <ReportActionItemBasicMessage message={ModifiedExpenseMessage.getForReportAction(props.report.reportID, props.action)} />;
} else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED) {
children = <ReportActionItemBasicMessage message={ReportActionsUtils.getMarkedReimbursedMessage(props.action)} />;
} else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {
children = <ReportActionItemBasicMessage message={props.translate('iou.heldRequest', {comment: lodashGet(props, 'action.message[1].text', '')})} />;
} else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) {
children = <ReportActionItemBasicMessage message={props.translate('iou.unheldRequest')} />;
} else {
const hasBeenFlagged =
!_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision) &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/HoldReasonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function HoldReasonPage({route}: HoldReasonPageProps) {
valueType="string"
name="comment"
defaultValue={undefined}
label="Reason"
label={translate('iou.reason')}
accessibilityLabel={translate('iou.reason')}
autoFocus
/>
Expand Down

0 comments on commit 292605f

Please sign in to comment.