added translation of dialogContext

This commit is contained in:
Pushpendra Kumar
2023-12-13 10:54:09 +01:00
committed by Adam Saghy
parent 6e068189be
commit 927562a872
31 changed files with 3360 additions and 2994 deletions
@@ -18,6 +18,7 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
/**
* Charges Tab Component
@@ -60,12 +61,13 @@ export class ChargesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute,
private savingsService: SavingsService,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private settingsService: SettingsService, ) {
this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => {
private savingsService: SavingsService,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private translateService: TranslateService,
private settingsService: SettingsService,) {
this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => {
this.recurringDepositsAccountData = data.recurringDepositsAccountData;
this.chargesData = this.recurringDepositsAccountData.charges;
});
@@ -126,7 +128,7 @@ export class ChargesTabComponent implements OnInit {
* @param {any} chargeId Charge Id
*/
waiveCharge(chargeId: any) {
const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${chargeId}?` } });
const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ')+ `${chargeId} ?` } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.savingsService.executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'waive', {}, chargeId)
@@ -14,6 +14,7 @@ import { RecurringDepositsButtonsConfiguration } from './recurring-deposits-butt
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { RecurringDepositConfirmationDialogComponent } from './custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component';
import { Currency } from 'app/shared/models/general.model';
import { TranslateService } from '@ngx-translate/core';
/**
@@ -48,7 +49,8 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
private router: Router,
private recurringDepositsService: RecurringDepositsService,
private savingsService: SavingsService,
public dialog: MatDialog) {
public dialog: MatDialog,
private translateService:TranslateService) {
this.route.data.subscribe((data: { recurringDepositsAccountData: any, savingsDatatables: any }) => {
this.recurringDepositsAccountData = data.recurringDepositsAccountData;
this.charges = this.recurringDepositsAccountData.charges;
@@ -207,7 +209,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private calculateInterest() {
const calculateInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Calculate Interest', dialogContext: `Are you sure you want to calculate interest ?` }
data: { heading: 'Calculate Interest', dialogContext: this.translateService.instant(`labels.dialogContext.Are you sure you want to calculate interest ?`) }
});
calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -223,7 +225,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private postInterest() {
const postInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Post Interest', dialogContext: 'Are you sure you want to post interest ?' }
data: { heading: 'Post Interest', dialogContext:this.translateService.instant('lables.dialogContext.Are you sure you want to post interest ?') }
});
postInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -241,7 +243,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private enableWithHoldTax() {
const deleteSavingsAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Enable Withhold Tax', dialogContext: `Enable withhold tax for this account ?` }
data: { heading: 'Enable Withhold Tax', dialogContext: this.translateService.instant('labels.dialogContext.Enable withhold tax for this account ?') }
});
deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -259,7 +261,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private disableWithHoldTax() {
const disableWithHoldTaxDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Disable Withhold Tax', dialogContext: 'Disable withhold tax for this account ?' }
data: { heading: 'Disable Withhold Tax', dialogContext: this.translateService.instant('labels.dialogContext.Disable withhold tax for this account ?') }
});
disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -10,6 +10,7 @@ import { SettingsService } from 'app/settings/settings.service';
/** Custom Dialogs */
import { RecurringDepositConfirmationDialogComponent } from '../../custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
/**
* View Transaction Component.
@@ -24,6 +25,7 @@ export class ViewTransactionComponent {
/** Transaction data. */
transactionData: any;
/**
* Retrieves the Transaction data from `resolve`.
@@ -39,6 +41,7 @@ export class ViewTransactionComponent {
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private translateService:TranslateService,
private settingsService: SettingsService, ) {
this.route.data.subscribe((data: { recurringDepositsAccountTransaction: any }) => {
this.transactionData = data.recurringDepositsAccountTransaction;
@@ -50,7 +53,7 @@ export class ViewTransactionComponent {
*/
undoTransaction() {
const accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Undo Transaction', dialogContext: 'Are you sure you want to undo this transaction ?' } });
const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Undo Transaction', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to undo this transaction ?') } });
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
const locale = this.settingsService.language.code;