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

Adds translation for hold violation #42470

Merged
merged 2 commits into from
May 27, 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
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3673,6 +3673,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 @@ -3059,6 +3059,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 @@ -3563,6 +3563,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
Loading