Skip to content

Commit

Permalink
Merge pull request #42470 from Expensify/rodrigo-fix-hold-text
Browse files Browse the repository at this point in the history
Adds translation for hold violation
  • Loading branch information
puneetlath authored May 27, 2024
2 parents b7d6a68 + fd5c9db commit 67b8b38
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3675,6 +3675,7 @@ const CONST = {
TAX_OUT_OF_POLICY: 'taxOutOfPolicy',
TAX_RATE_CHANGED: 'taxRateChanged',
TAX_REQUIRED: 'taxRequired',
HOLD: 'hold',
},

/** Context menu types */
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useViolations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {TransactionViolation, ViolationName} from '@src/types/onyx';
/**
* Names of Fields where violations can occur.
*/
type ViolationField = 'amount' | 'billable' | 'category' | 'comment' | 'date' | 'merchant' | 'receipt' | 'tag' | 'tax';
type ViolationField = 'amount' | 'billable' | 'category' | 'comment' | 'date' | 'merchant' | 'receipt' | 'tag' | 'tax' | 'none';

/**
* Map from Violation Names to the field where that violation can occur.
Expand Down Expand Up @@ -44,6 +44,7 @@ const violationFields: Record<ViolationName, ViolationField> = {
taxOutOfPolicy: 'tax',
taxRateChanged: 'tax',
taxRequired: 'tax',
hold: 'none',
};

type ViolationsMap = Map<ViolationField, TransactionViolation[]>;
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,7 @@ export default {
taxOutOfPolicy: ({taxName}: ViolationsTaxOutOfPolicyParams) => `${taxName ?? 'Tax'} no longer valid`,
taxRateChanged: 'Tax rate was modified',
taxRequired: 'Missing tax rate',
hold: 'Hold',
},
violationDismissal: {
rter: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3567,6 +3567,7 @@ export default {
taxOutOfPolicy: ({taxName}: ViolationsTaxOutOfPolicyParams) => `${taxName ?? 'El impuesto'} ya no es válido`,
taxRateChanged: 'La tasa de impuesto fue modificada',
taxRequired: 'Falta la tasa de impuesto',
hold: 'Bloqueada',
},
violationDismissal: {
rter: {
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Violations/ViolationsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ const ViolationsUtils = {
return translate('violations.taxRateChanged');
case 'taxRequired':
return translate('violations.taxRequired');
case 'hold':
return translate('violations.hold');
default:
// The interpreter should never get here because the switch cases should be exhaustive.
// If typescript is showing an error on the assertion below it means the switch statement is out of
Expand Down

0 comments on commit 67b8b38

Please sign in to comment.