Skip to content
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

Handle translations in hold money request workflow #36851

Merged
merged 6 commits into from
Feb 20, 2024
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
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 @@ -3519,7 +3519,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 @@ -3554,7 +3554,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
Loading