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 2 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
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ export default {
hold: 'Hold',
holdRequest: 'Hold Request',
unholdRequest: 'Unhold Request',
heldRequest: (comment) => `held this money request with the comment: ${comment}`,
unheldRequest: 'unheld this money request',
explainHold: "Explain why you're holding this request.",
reason: 'Reason',
holdReasonRequired: 'A reason is required when holding.',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ export default {
enableWallet: 'Habilitar Billetera',
holdRequest: 'Bloquear solicitud de dinero',
unholdRequest: 'Desbloquear solicitud de dinero',
heldRequest: (comment) => `celebró esta solicitud de dinero con el comentario: ${comment}`,
unheldRequest: 'esta solicitud de dinero no retenida',
explainHold: 'Explica la razón para bloquear esta solicitud.',
reason: 'Razón',
holdReasonRequired: 'Se requiere una razón para bloquear.',
Expand Down
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 === 'HOLD') {
children = <ReportActionItemBasicMessage message={props.translate('iou.heldRequest', props.action.message[1].text)} />;
} else if (props.action.actionName === '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