Skip to content

Commit

Permalink
Refactor translation keys (#17920)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larisa-Staroverova authored Oct 9, 2023
1 parent d8a3cdf commit de90db0
Show file tree
Hide file tree
Showing 16 changed files with 217 additions and 217 deletions.
272 changes: 136 additions & 136 deletions feature-libs/quote/assets/translations/en/quote.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,153 +6,127 @@

export const quote = {
quote: {
list: {
name: 'Name',
updated: 'Updated',
sortBy: 'Sort by',
sortOrders: 'Sort orders',
empty: 'We have no quote records for this account.',
},
states: {
BUYER_DRAFT: 'Draft',
BUYER_SUBMITTED: 'Submitted',
BUYER_ACCEPTED: 'Accepted',
BUYER_APPROVED: 'Approved',
BUYER_REJECTED: 'Rejected',
BUYER_OFFER: 'Vendor Quote',
BUYER_ORDERED: 'Ordered',
SELLER_DRAFT: 'Draft',
SELLER_REQUEST: 'Requested',
SELLER_SUBMITTED: 'Submitted',
SELLERAPPROVER_DRAFT: 'Draft',
SELLERAPPROVER_PENDING: 'Pending Approval',
SELLERAPPROVER_APPROVED: 'Approved',
SELLERAPPROVER_REJECTED: 'Rejected',
CREATED: 'Created',
CANCELLED: 'Cancelled',
EXPIRED: 'Expired',
},
actions: {
VIEW: 'View Quote',
SUBMIT: 'Submit Quote',
SAVE: 'Save Quote',
EDIT: 'Edit Quote',
CANCEL: 'Cancel Quote',
CHECKOUT: 'Accept and Checkout',
APPROVE: 'Approve Quote',
REJECT: 'Reject Quote',
REQUOTE: 'Request new Quote',
},
commons: {
id: 'Quote ID',
status: 'Status',
creationSuccess: 'Quote #{{ code }} created successfully',
cart: 'Cart',
},
seller: {
apply: 'Apply',
placeholder: '0',
discount: 'Discount',
expiryDate: 'Expiry Date',
discountValidationText: 'Enter a valid absolute discount',
byRole: {
VIEW: 'View Quote',
SUBMIT: 'Submit Quote',
SAVE: 'Save Quote',
EDIT: 'Edit Quote',
CANCEL: 'Cancel Quote',
CHECKOUT: 'Accept and Checkout',
APPROVE: 'Approve Quote',
REJECT: 'Reject Quote',
REQUOTE: 'Request new Quote',
},
link: {
newCart: 'New Cart',
quotes: 'Quotes',
},
confirmDialog: {
name: 'Name:',
description: 'Description:',
validity: 'This quote is valid until {{ expirationTime }}',
option: { yes: 'Yes', no: 'No' },
buyer: {
submit: {
title: 'Submit Quote Request {{ code }}?',
confirmNote: 'Are you sure you want to submit this quote request?',
successMessage: 'Quote request submitted successfully',
},
cancel: {
title: 'Cancel Quote Request {{ code }}?',
confirmNote: 'Are you sure you want to cancel this quote request',
successMessage: 'Quote request cancelled',
},
},
buyer_offer: {
edit: {
title: 'Confirm Edit Quote {{ code }}?',
confirmNote: 'Are you sure you want to edit this approved quote?',
warningNote:
'This Quote has been Approved. Editing this Quote will prevent Checkout until new edits are approved.',
},
cancel: {
title: 'Cancel Quote {{ code }}?',
confirmNote: 'Are you sure you want to cancel this quote?',
successMessage: 'Quote cancelled',
},
checkout: {
title: 'Checkout Quote {{ code }}?',
confirmNote:
'Are you sure you want to accept and checkout this quote?',
},
},
expired: {
edit: {
title: 'Confirm Edit Quote {{ code }}?',
confirmNote: 'Are you sure you want to edit this expired quote?',
warningNote:
'This Quote is expired. Editing this quote will prevent checkout until new edits are approved.',
},
requote: {
title: 'Recreate Quote Request {{ code }}?',
confirmNote:
'Are you sure you want to recreate this quote request?',
warningNote:
'This Quote is expired. Re-quoting it will create a new quote request with same contents, which can be edited and submitted for approval afterwards.',
},
},
seller: {
submit: {
title: 'Submit Quote {{ code }}?',
confirmNote: 'Are you sure you want to submit this quote?',
warningNote:
'Depending on the total value of the quote, an additional approval might be required before the buyer can check out this quote.',
successMessage: 'Quote submitted successfully',
},
},
approver: {
approve: {
title: 'Approve Quote {{ code }}?',
confirmNote: 'Are you sure you want to approve this quote?',
successMessage: 'Quote approved successfully',
},
reject: {
title: 'Reject Quote {{ code }}?',
confirmNote: 'Are you sure you want to reject this quote?',
successMessage: 'Quote rejected',
},
},
},
},
comments: {
title: 'Contact',
invalidComment: 'Invalid Input - Please type again...',
allProducts: 'All Products',
},
details: {
information: 'Quote Information',
code: 'Quote ID',
name: 'Name',
created: 'Created',
lastUpdated: 'Last Updated',
estimatedTotal: 'Estimated Total',
total: 'Total',
description: 'Description',
estimateAndDate: 'Estimated & Date',
update: 'Update',
expirationTime: 'Expiry Date',
charactersLeft: 'characters left: {{count}}',
},
links: {
newCart: 'New Cart',
quotes: 'Quotes',
},
request: {
commons: {
requestQuote: 'Request Quote',
cart: 'Cart',
minRequestInitiationNote:
'Minimum ${{minValue}} subtotal is required to submit a quote ',
requestQuote: 'Request Quote',
},
confirmActionDialog: {
name: 'Name:',
description: 'Description:',
validity: 'This quote is valid until {{ expirationTime }}',
confirmActionOption: { yes: 'Yes', no: 'No' },
buyer: {
submit: {
title: 'Submit Quote Request {{ code }}?',
confirmNote: 'Are you sure you want to submit this quote request?',
successMessage: 'Quote request submitted successfully',
},
cancel: {
title: 'Cancel Quote Request {{ code }}?',
confirmNote: 'Are you sure you want to cancel this quote request',
successMessage: 'Quote request cancelled',
},
header: {
overview: {
id: 'Quote ID',
status: 'Status',
information: 'Quote Information',
name: 'Name',
created: 'Created',
lastUpdated: 'Last Updated',
estimatedTotal: 'Estimated Total',
total: 'Total',
description: 'Description',
estimateAndDate: 'Estimated & Date',
update: 'Update',
expirationTime: 'Expiry Date',
charactersLeft: 'characters left: {{count}}',
},
buyer_offer: {
edit: {
title: 'Confirm Edit Quote {{ code }}?',
confirmNote: 'Are you sure you want to edit this approved quote?',
warningNote:
'This Quote has been Approved. Editing this Quote will prevent Checkout until new edits are approved.',
},
cancel: {
title: 'Cancel Quote {{ code }}?',
confirmNote: 'Are you sure you want to cancel this quote?',
successMessage: 'Quote cancelled',
},
checkout: {
title: 'Checkout Quote {{ code }}?',
confirmNote:
'Are you sure you want to accept and checkout this quote?',
},
},
expired: {
edit: {
title: 'Confirm Edit Quote {{ code }}?',
confirmNote: 'Are you sure you want to edit this expired quote?',
warningNote:
'This Quote is expired. Editing this quote will prevent checkout until new edits are approved.',
},
requote: {
title: 'Recreate Quote Request {{ code }}?',
confirmNote: 'Are you sure you want to recreate this quote request?',
warningNote:
'This Quote is expired. Re-quoting it will create a new quote request with same contents, which can be edited and submitted for approval afterwards.',
},
},
seller: {
submit: {
title: 'Submit Quote {{ code }}?',
confirmNote: 'Are you sure you want to submit this quote?',
warningNote:
'Depending on the total value of the quote, an additional approval might be required before the buyer can check out this quote.',
successMessage: 'Quote submitted successfully',
},
},
approver: {
approve: {
title: 'Approve Quote {{ code }}?',
confirmNote: 'Are you sure you want to approve this quote?',
successMessage: 'Quote approved successfully',
},
reject: {
title: 'Reject Quote {{ code }}?',
confirmNote: 'Are you sure you want to reject this quote?',
successMessage: 'Quote rejected',
},
sellerEdit: {
apply: 'Apply',
discount: 'Discount',
expiryDate: 'Expiry Date',
discountValidationText: 'Enter a valid absolute discount',
},
},
httpHandlers: {
Expand All @@ -170,5 +144,31 @@ export const quote = {
expired:
'This quote has expired. You must resubmit your quote request to receive another vendor quote.',
},
list: {
name: 'Name',
updated: 'Updated',
sortBy: 'Sort by',
sortOrders: 'Sort orders',
empty: 'We have no quote records for this account.',
},
states: {
BUYER_DRAFT: 'Draft',
BUYER_SUBMITTED: 'Submitted',
BUYER_ACCEPTED: 'Accepted',
BUYER_APPROVED: 'Approved',
BUYER_REJECTED: 'Rejected',
BUYER_OFFER: 'Vendor Quote',
BUYER_ORDERED: 'Ordered',
SELLER_DRAFT: 'Draft',
SELLER_REQUEST: 'Requested',
SELLER_SUBMITTED: 'Submitted',
SELLERAPPROVER_DRAFT: 'Draft',
SELLERAPPROVER_PENDING: 'Pending Approval',
SELLERAPPROVER_APPROVED: 'Approved',
SELLERAPPROVER_REJECTED: 'Rejected',
CREATED: 'Created',
CANCELLED: 'Cancelled',
EXPIRED: 'Expired',
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[disabled]="mustDisableAction(action.type, quoteDetails)"
(click)="onClick(action.type, quoteDetails)"
>
{{ 'quote.actions.' + action.type | cxTranslate }}
{{ 'quote.actions.byRole.' + action.type | cxTranslate }}
</button>
</section>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ const mockQuote: Quote = {
const testMappings: ConfirmActionDialogMappingConfig = {
BUYER_OFFER: {
EDIT: {
i18nKey: 'quote.confirmActionDialog.buyer_offer.edit',
i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit',
showWarningNote: true,
showExpirationDate: true,
showSuccessMessage: false,
},
},
BUYER: {
SUBMIT: {
i18nKey: 'quote.confirmActionDialog.buyer.submit',
i18nKey: 'quote.actions.confirmDialog.buyer.submit',
showWarningNote: false,
showExpirationDate: false,
showSuccessMessage: true,
},
},
EXPIRED: {
REQUOTE: {
i18nKey: 'quote.confirmActionDialog.expired.requote',
i18nKey: 'quote.actions.confirmDialog.expired.requote',
showWarningNote: true,
showExpirationDate: false,
showSuccessMessage: false,
Expand Down Expand Up @@ -201,9 +201,9 @@ describe('QuoteActionsByRoleComponent', () => {
};
const confirmationContextForSubmitAction: ConfirmationContext = {
quote: quoteForSubmitAction,
title: 'quote.confirmActionDialog.buyer.submit.title',
confirmNote: 'quote.confirmActionDialog.buyer.submit.confirmNote',
successMessage: 'quote.confirmActionDialog.buyer.submit.successMessage',
title: 'quote.actions.confirmDialog.buyer.submit.title',
confirmNote: 'quote.actions.confirmDialog.buyer.submit.confirmNote',
successMessage: 'quote.actions.confirmDialog.buyer.submit.successMessage',
};
mockQuoteDetails$.next(quoteForSubmitAction);
fixture.detectChanges();
Expand All @@ -229,10 +229,10 @@ describe('QuoteActionsByRoleComponent', () => {
};
const confirmationContextForEditAction: ConfirmationContext = {
quote: quoteInBuyerOfferState,
title: 'quote.confirmActionDialog.buyer_offer.edit.title',
confirmNote: 'quote.confirmActionDialog.buyer_offer.edit.confirmNote',
warningNote: 'quote.confirmActionDialog.buyer_offer.edit.warningNote',
validity: 'quote.confirmActionDialog.validity',
title: 'quote.actions.confirmDialog.buyer_offer.edit.title',
confirmNote: 'quote.actions.confirmDialog.buyer_offer.edit.confirmNote',
warningNote: 'quote.actions.confirmDialog.buyer_offer.edit.warningNote',
validity: 'quote.actions.confirmDialog.validity',
};
mockQuoteDetails$.next(quoteInBuyerOfferState);
fixture.detectChanges();
Expand Down Expand Up @@ -271,9 +271,9 @@ describe('QuoteActionsByRoleComponent', () => {
};
const confirmationContextForRequoteAction: ConfirmationContext = {
quote: expiredQuote,
title: 'quote.confirmActionDialog.expired.requote.title',
confirmNote: 'quote.confirmActionDialog.expired.requote.confirmNote',
warningNote: 'quote.confirmActionDialog.expired.requote.warningNote',
title: 'quote.actions.confirmDialog.expired.requote.title',
confirmNote: 'quote.actions.confirmDialog.expired.requote.confirmNote',
warningNote: 'quote.actions.confirmDialog.expired.requote.warningNote',
};
mockQuoteDetails$.next(expiredQuote);
fixture.detectChanges();
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('QuoteActionsByRoleComponent', () => {
QuoteState.BUYER_OFFER
)
).toEqual({
i18nKey: 'quote.confirmActionDialog.buyer_offer.edit',
i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit',
showWarningNote: true,
showExpirationDate: true,
showSuccessMessage: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy {
if (mustDisableAction) {
this.globalMessageService.add(
{
key: 'quote.request.minRequestInitiationNote',
key: 'quote.commons.minRequestInitiationNote',
params: {
minValue: quote.threshold,
},
Expand Down Expand Up @@ -181,7 +181,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy {
confirmationContext.warningNote = dialogConfig.i18nKey + '.warningNote';
}
if (dialogConfig.showExpirationDate) {
confirmationContext.validity = 'quote.confirmActionDialog.validity';
confirmationContext.validity = 'quote.actions.confirmDialog.validity';
}
if (dialogConfig.showSuccessMessage) {
confirmationContext.successMessage =
Expand Down
Loading

0 comments on commit de90db0

Please sign in to comment.