Skip to content

Commit

Permalink
add missed translation for products module
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar-Nabil committed May 31, 2024
1 parent f903bc2 commit 604b05b
Show file tree
Hide file tree
Showing 60 changed files with 440 additions and 331 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ <h4 fxFlex="63%" class="mat-h4">{{'labels.heading.Configure Fund Sources for Pay
*ngIf="paymentChannelToFundSourceMappings.value.length !== 0">

<ng-container matColumnDef="paymentTypeId">
<th mat-header-cell *matHeaderCellDef> Payment Type </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.heading.Payment Type' | translate}} </th>
<td mat-cell *matCellDef="let paymentFundSource">
{{ paymentFundSource.paymentTypeId | find:paymentTypeData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="fundSourceAccountId">
<th mat-header-cell *matHeaderCellDef> Fund Source </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Fund Source' | translate}} </th>
<td mat-cell *matCellDef="let paymentFundSource">
{{ paymentFundSource.fundSourceAccountId | find:assetAccountData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.buttons.Actions' | translate}} </th>
<td mat-cell *matCellDef="let paymentFundSource; let i = index">
<button mat-icon-button color="primary"
(click)="edit('PaymentFundSource', paymentChannelToFundSourceMappings, i)">
Expand Down Expand Up @@ -144,21 +144,21 @@ <h4 fxFlex="63%" class="mat-h4">{{'labels.heading.Map Fees to Specific Income Ac
*ngIf="feeToIncomeAccountMappings.value.length !== 0">

<ng-container matColumnDef="chargeId">
<th mat-header-cell *matHeaderCellDef> Fees </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.catalogs.Fees' | translate}} </th>
<td mat-cell *matCellDef="let feesIncome">
{{ feesIncome.chargeId | find:chargeData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="incomeAccountId">
<th mat-header-cell *matHeaderCellDef> Income Account </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Income Account' | translate}} </th>
<td mat-cell *matCellDef="let feesIncome">
{{ feesIncome.incomeAccountId | find:incomeAccountData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.buttons.Actions' | translate}} </th>
<td mat-cell *matCellDef="let feesIncome; let i = index">
<button mat-icon-button color="primary" (click)="edit('FeesIncome', feeToIncomeAccountMappings, i)">
<fa-icon icon="edit"></fa-icon>
Expand Down Expand Up @@ -193,21 +193,21 @@ <h4 fxFlex="63%" class="mat-h4">{{'labels.heading.Map Penalties to Specific Inco
*ngIf="penaltyToIncomeAccountMappings.value.length !== 0">

<ng-container matColumnDef="chargeId">
<th mat-header-cell *matHeaderCellDef> Penalty </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Penalty' | translate}} </th>
<td mat-cell *matCellDef="let penaltyIncome">
{{ penaltyIncome.chargeId | find:penaltyData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="incomeAccountId">
<th mat-header-cell *matHeaderCellDef> Income Account </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Income Account' | translate}} </th>
<td mat-cell *matCellDef="let penaltyIncome">
{{ penaltyIncome.incomeAccountId | find:incomeAccountData:'id':'name' }}
</td>
</ng-container>

<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.buttons.Actions' | translate}} </th>
<td mat-cell *matCellDef="let penaltyIncome; let i = index">
<button mat-icon-button color="primary"
(click)="edit('PenaltyIncome', penaltyToIncomeAccountMappings, i)">
Expand Down Expand Up @@ -242,4 +242,4 @@ <h4 fxFlex="63%" class="mat-h4">{{'labels.heading.Map Penalties to Specific Inco
</button>
</div>

</form>
</form>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Component, OnInit, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, UntypedFormArray, Validators, UntypedFormControl } from '@angular/forms';
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';

import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';

import { TranslateService } from '@ngx-translate/core';
import { Accounting } from 'app/core/utils/accounting';
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
import { Accounting } from 'app/core/utils/accounting';

@Component({
selector: 'mifosx-fixed-deposit-product-accounting-step',
Expand Down Expand Up @@ -35,7 +36,8 @@ export class FixedDepositProductAccountingStepComponent implements OnInit {

constructor(private formBuilder: UntypedFormBuilder,
public dialog: MatDialog,
private accounting: Accounting) {
private accounting: Accounting,
private translateService: TranslateService) {
this.createfixedDepositProductAccountingForm();
this.setConditionalControls();
}
Expand Down Expand Up @@ -206,7 +208,7 @@ export class FixedDepositProductAccountingStepComponent implements OnInit {

delete(formArray: UntypedFormArray, index: number) {
const dialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `this` }
data: { deleteContext: this.translateService.instant('labels.text.this') }
});
dialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Component, OnInit, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormControl } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';

import { TranslateService } from '@ngx-translate/core';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';

@Component({
Expand All @@ -19,7 +20,8 @@ export class FixedDepositProductChargesStepComponent implements OnInit {
chargesDataSource: {}[];
displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action'];

constructor(public dialog: MatDialog) {
constructor(public dialog: MatDialog,
private translateService: TranslateService) {
}

ngOnInit() {
Expand All @@ -39,7 +41,7 @@ export class FixedDepositProductChargesStepComponent implements OnInit {

deleteCharge(charge: any) {
const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `charge ${charge.name}` }
data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name }
});
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4 fxFlex="83%" class="mat-h3">{{ 'labels.inputs.Interest Rate Chart' | transla
<mat-datepicker-toggle matSuffix [for]="validFromDatePicker"></mat-datepicker-toggle>
<mat-datepicker #validFromDatePicker></mat-datepicker>
<mat-error>
Valid from Date {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
{{'labels.inputs.Valid from Date' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormArray } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { TooltipPosition } from '@angular/material/tooltip';
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';

/** Custom Components */
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
import { DepositProductIncentiveFormDialogComponent } from 'app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';

/** Dialog Components */
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';

/** Custom Services */
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
import { Dates } from 'app/core/utils/dates';
import { SettingsService } from 'app/settings/settings.service';

@Component({
selector: 'mifosx-fixed-deposit-product-interest-rate-chart-step',
Expand Down Expand Up @@ -284,7 +283,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
}

editChartSlab(chartSlabs: UntypedFormArray, chartSlabIndex: number) {
const data = { ...this.getData('Slab', chartSlabs.at(chartSlabIndex).value), layout: { addButtonText: 'Edit' } };
const data = { ...this.getData('Slab', chartSlabs.at(chartSlabIndex).value), layout: { addButtonText: this.translateService.instant('labels.text.this') } };
const dialogRef = this.dialog.open(FormDialogComponent, { data });
dialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
Expand All @@ -294,7 +293,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
}

editIncentive(incentives: UntypedFormArray, incentiveIndex: number) {
const data = { ...this.getData('Incentive', incentives.at(incentiveIndex).value), layout: { addButtonText: 'Edit' } };
const data = { ...this.getData('Incentive', incentives.at(incentiveIndex).value), layout: { addButtonText: this.translateService.instant('labels.text.this') } };
const dialogRef = this.dialog.open(DepositProductIncentiveFormDialogComponent, { data });
dialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
Expand All @@ -305,7 +304,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit

delete(formArray: UntypedFormArray, index: number) {
const dialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `this` }
data: { deleteContext: this.translateService.instant('labels.text.this') }
});
dialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
</div>

<ng-template #templateButtonCreateFixedProduct let-popover="popover">
<h2>Create fixed deposit product</h2>
<p class="mw300">This option allows you to create new fixed deposit product.</p>
<h2>{{'labels.buttons.Create Fixed Deposit Product' | translate}}</h2>
<p class="mw300">{{'labels.text.Allows you to create new fixed deposit product' | translate}}</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">{{'labels.buttons.Back' | translate}}</button>
Expand All @@ -52,7 +52,7 @@ <h2>Create fixed deposit product</h2>
</ng-template>

<ng-template #templateFilter let-popover="popover">
<h4>Search bar to filter fixed deposit products.</h4>
<h4>{{'labels.text.Search bar to filter fixed deposit products.' | translate}}</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonCreateFixedProduct,buttonCreateFixedProduct , 'bottom', true)">{{'labels.buttons.Back' | translate}}</button>
Expand All @@ -61,7 +61,7 @@ <h4>Search bar to filter fixed deposit products.</h4>
</ng-template>

<ng-template #templateFixedProductsTable let-popover="popover">
<h4 class="mw300">List of fixed deposit products in the organization. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/102629544/Fixed+Deposit+Products" target="_blank">{{'labels.inputs.Fixed Deposit Products' | translate}}</a></h4>
<h4 class="mw300">{{'labels.text.List of fixed deposit products in the organization' | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/102629544/Fixed+Deposit+Products" target="_blank">{{'labels.inputs.Fixed Deposit Products' | translate}}</a></h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate}}</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">{{'labels.buttons.Back' | translate}}</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@
<div fxLayout="row wrap" fxLayout.lt-md="column" fxLayoutGap="4%">

<mat-form-field fxFlex="30%">
<mat-label>Floating Rate Name</mat-label>
<mat-label>{{'labels.inputs.Floating Rate Name' | translate}}</mat-label>
<input matInput required matTooltip="Unique name for the floating rate scheme." formControlName="name">
<mat-error *ngIf="floatingRateForm.controls.name.hasError('required')">
Floating Rate Name is <strong>required</strong>
{{'labels.inputs.Floating Rate Name' | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>

<div class="checkbox-wrapper" fxFlex="30%">
<mat-checkbox formControlName="isBaseLendingRate" matTooltip="Check if this floating rate scheme is to be considered base lending rate for the organisation" class="checkbox" labelPosition="before">Is Base Lending
Rate?</mat-checkbox>
<mat-checkbox formControlName="isBaseLendingRate" matTooltip="Check if this floating rate scheme is to be considered base lending rate for the organisation" class="checkbox" labelPosition="before">{{'labels.inputs.Is Base Lending Rate' | translate}}?</mat-checkbox>
</div>

<div class="checkbox-wrapper" fxFlex="30%">
<mat-checkbox formControlName="isActive" matTooltip="Check if this floating rate scheme to be activated" class="checkbox" labelPosition="before">Active</mat-checkbox>
<mat-checkbox formControlName="isActive" matTooltip="Check if this floating rate scheme to be activated" class="checkbox" labelPosition="before">{{'labels.inputs.Active' | translate}}</mat-checkbox>
</div>

</div>
Expand All @@ -35,7 +34,7 @@

<div fxLayout="row wrap" fxLayoutGap="70%" fxLayoutGap.lt-md="0px" class="m-b-10" fxLayout.lt-md="column">

<p fxFlex="25%" class="mat-title">Floating Rate Periods <i class="fas fa-question" matTooltip="Floating interest rate and start date for this floating rate scheme"></i></p>
<p fxFlex="25%" class="mat-title">{{'labels.inputs.Floating Rate Periods' | translate}} <i class="fas fa-question" matTooltip="Floating interest rate and start date for this floating rate scheme"></i></p>

<button mat-mini-fab type="button" color="primary" (click)="addFloatingRatePeriod()">
<fa-icon icon="plus"></fa-icon>
Expand All @@ -46,17 +45,17 @@
<table mat-table [dataSource]="dataSource" matSort>

<ng-container matColumnDef="fromDate">
<th mat-header-cell *matHeaderCellDef matTooltip="Interest effective from date" mat-sort-header> From Date </th>
<th mat-header-cell *matHeaderCellDef matTooltip="Interest effective from date" mat-sort-header> {{'labels.inputs.From Date' | translate}} </th>
<td mat-cell *matCellDef="let floatingRatePeriod"> {{ floatingRatePeriod.fromDate | dateFormat }} </td>
</ng-container>

<ng-container matColumnDef="interestRate">
<th mat-header-cell *matHeaderCellDef matTooltip="Annualised Interest rate" mat-sort-header> Interest Rate </th>
<th mat-header-cell *matHeaderCellDef matTooltip="Annualised Interest rate" mat-sort-header> {{'labels.inputs.Interest Rate' | translate}} </th>
<td mat-cell *matCellDef="let floatingRatePeriod"> {{ floatingRatePeriod.interestRate | formatNumber }} </td>
</ng-container>

<ng-container matColumnDef="isDifferential">
<th mat-header-cell *matHeaderCellDef matTooltip="If checked, Interest rate mentioned is added to base lending rate as of the from date of this period, absolute otherwise" mat-sort-header> Is Differential? </th>
<th mat-header-cell *matHeaderCellDef matTooltip="If checked, Interest rate mentioned is added to base lending rate as of the from date of this period, absolute otherwise" mat-sort-header> {{'labels.inputs.Is Differential' | translate}}? </th>
<td mat-cell *matCellDef="let floatingRate">
<fa-icon *ngIf="floatingRate.isDifferentialToBaseLendingRate" icon="check-circle" size="lg"
class="is-differential" matTooltip="Yes" matTooltipPosition="right"></fa-icon>
Expand All @@ -66,7 +65,7 @@
</ng-container>

<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
<td mat-cell *matCellDef="let floatingRatePeriod" fxLayoutGap="15%">
<button type="button" fxFlex="8%" color="primary" mat-icon-button matTooltip="Edit Period" matTooltipPosition="left"
(click)="editFloatingRatePeriod(floatingRatePeriod)">
Expand All @@ -89,8 +88,8 @@
</mat-card-content>

<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button mat-raised-button type="submit" color="primary" [disabled]="!floatingRateForm.valid" *mifosxHasPermission="'CREATE_FLOATINGRATE'">Submit</button>
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button type="submit" color="primary" [disabled]="!floatingRateForm.valid" *mifosxHasPermission="'CREATE_FLOATINGRATE'">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>

</form>
Expand Down
Loading

0 comments on commit 604b05b

Please sign in to comment.