i18n: Adding new languages: Part 1 (#1882)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-10-22 20:18:05 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent c7fe21e74a
commit 408f004450
432 changed files with 38051 additions and 44613 deletions
@@ -2,8 +2,7 @@
<div class="mat-elevation-z8">
<div *ngIf="!isBusinessDateEnabled">
<p>The Business Date functionality is not enabled. If you need that, Go to Global Configurations and enable the
configuration: <code>{{configurationName}}</code></p>
<p>{{'labels.text.Business Date functionality is not enabled' | translate}}: <code>{{configurationName}}</code></p>
</div>
<div *ngIf="isBusinessDateEnabled">
@@ -13,7 +12,7 @@
<mat-card-content>
<div fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column" class="space">
<div fxFlex="50%">
<span fxFlex="40%" class="date-type">User date format: </span>
<span fxFlex="40%" class="date-type">{{'labels.inputs.User date format' | translate}}: </span>
<span fxFlex="60%" class="date-value">{{userDateFormat}}</span>
</div>
</div>
@@ -21,19 +20,19 @@
<!-- Business Date -->
<div fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<div fxFlex="50%" *ngIf="!isEditInProgress">
<span fxFlex="40%" class="date-type">Business Date: </span>
<span fxFlex="40%" class="date-type">{{'labels.inputs.Business Date' | translate}}: </span>
<span fxFlex="60%" class="date-value">{{businessDate | dateFormat}}</span>
</div>
<mat-form-field (click)="businessDatePicker.open()" *ngIf="isEditInProgress && (dateIndex == 0)">
<mat-label>Business Date</mat-label>
<mat-label>{{'labels.inputs.Business Date' | translate}}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="businessDatePicker"
formControlName="businessDate">
<mat-datepicker-toggle matSuffix [for]="businessDatePicker">
</mat-datepicker-toggle>
<mat-datepicker #businessDatePicker></mat-datepicker>
<mat-error *ngIf="businessDateForm.controls.businessDate.hasError('required')">
Business Date is <strong>required</strong>
{{'labels.inputs.Business Date' | translate}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
@@ -41,13 +40,13 @@
<span *ngIf="isEditInProgress && (dateIndex == 0)">
<button mat-raised-button color="primary" [disabled]="businessDateForm.pristine" (click)="submit()"
*mifosxHasPermission="'UPDATE_BUSINESSDATE'">
Submit
{{'labels.buttons.Submit' | translate}}
</button>
<button mat-raised-button (click)="editInProgressToggle(0)">
Cancel
{{'labels.buttons.Cancel' | translate}}
</button>
</span>
<button type="button" color="primary" *ngIf="!isEditInProgress" mat-icon-button matTooltip="Edit the Business Date"
<button type="button" color="primary" *ngIf="!isEditInProgress" mat-icon-button matTooltip="{{ 'tooltips.Edit the Business Date' | translate}}"
matTooltipPosition="above" (click)="editInProgressToggle(0)">
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
@@ -57,19 +56,19 @@
<!-- COB Date -->
<div fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<div fxFlex="50%" *ngIf="!isEditInProgress">
<span fxFlex="40%" class="date-type">COB Date: </span>
<span fxFlex="40%" class="date-type">{{'labels.inputs.COB Date' | translate}}: </span>
<span fxFlex="60%" class="date-value">{{cobDate | dateFormat}}</span>
</div>
<mat-form-field (click)="cobDatePicker.open()" *ngIf="isEditInProgress && (dateIndex == 1)">
<mat-label>COB Date</mat-label>
<mat-label>{{'labels.inputs.COB Date' | translate}}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="cobDatePicker"
formControlName="businessDate">
<mat-datepicker-toggle matSuffix [for]="cobDatePicker">
</mat-datepicker-toggle>
<mat-datepicker #cobDatePicker></mat-datepicker>
<mat-error *ngIf="businessDateForm.controls.cobDate.hasError('required')">
COB Date is <strong>required</strong>
{{'labels.inputs.COB Date' | translate}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
@@ -77,13 +76,13 @@
<span *ngIf="isEditInProgress && (dateIndex == 1)">
<button mat-stroked-button color="primary" [disabled]="businessDateForm.pristine" (click)="submit()"
*mifosxHasPermission="'UPDATE_BUSINESSDATE'">
Submit
{{'labels.buttons.Submit' | translate}}
</button>
</span>
<button mat-button *ngIf="isEditInProgress && (dateIndex == 1)" (click)="editInProgressToggle(1)">
Cancel
{{'labels.buttons.Cancel' | translate}}
</button>
<button type="button" color="primary" *ngIf="!isEditInProgress" mat-icon-button matTooltip="Edit the COB Date"
<button type="button" color="primary" *ngIf="!isEditInProgress" mat-icon-button matTooltip="{{ 'tooltips.Edit the COB Date' | translate}}"
matTooltipPosition="above" (click)="editInProgressToggle(1)">
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
@@ -2,7 +2,6 @@
import { Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { Alert } from 'app/core/alert/alert.model';
import { AlertService } from 'app/core/alert/alert.service';
import { Dates } from 'app/core/utils/dates';
@@ -1,10 +1,10 @@
<mat-card class="configurations-card">
<mat-card-content>
<mat-tab-group #tabGroup mat-align-tabs="center">
<mat-tab label="Global Configurations">
<mat-tab label="{{'labels.inputs.Global Configurations' | translate}}">
<mifosx-global-configurations-tab></mifosx-global-configurations-tab>
</mat-tab>
<mat-tab label="Business Date" *ngIf="isBusinessDateEnabled">
<mat-tab label="{{'labels.inputs.Business Date' | translate}}" *ngIf="isBusinessDateEnabled">
<mifosx-business-date-tab></mifosx-business-date-tab>
</mat-tab>
</mat-tab-group>
@@ -9,27 +9,27 @@
<div fxLayout="column">
<mat-form-field>
<mat-label>Configuration Name</mat-label>
<mat-label>{{'labels.inputs.Configuration Name' | translate}}</mat-label>
<input matInput required formControlName="name">
</mat-form-field>
<mat-form-field>
<mat-label>Description</mat-label>
<mat-label>{{'labels.inputs.Description' | translate}}</mat-label>
<textarea matInput formControlName="description" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
<mat-form-field>
<mat-label>Number Value</mat-label>
<mat-label>{{'labels.inputs.Number Value' | translate}}</mat-label>
<input matInput type="number" formControlName="value">
</mat-form-field>
<mat-form-field>
<mat-label>String Value</mat-label>
<mat-label>{{'labels.inputs.String Value' | translate}}</mat-label>
<input matInput formControlName="stringValue">
</mat-form-field>
<mat-form-field fxFlex="48%" (click)="configurationDatePicker.open()">
<mat-label>Date Value</mat-label>
<mat-label>{{'labels.inputs.Date Value' | translate}}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="configurationDatePicker" formControlName="dateValue">
<mat-datepicker-toggle matSuffix [for]="configurationDatePicker"></mat-datepicker-toggle>
<mat-datepicker #configurationDatePicker></mat-datepicker>
@@ -40,9 +40,9 @@
</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 type="button" mat-raised-button [routerLink]="['../..']"> {{'labels.buttons.Cancel' | translate}} </button>
<button mat-raised-button color="primary" [disabled]="configurationForm.pristine || !configurationForm.valid">
Submit </button>
{{'labels.buttons.Submit' | translate}} </button>
</mat-card-actions>
</form>
@@ -2,7 +2,7 @@
<div #filter fxLayout="row">
<mat-form-field fxFlex>
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<mat-label>{{'labels.inputs.Filter' | translate }}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)">
</mat-form-field>
</div>
@@ -12,41 +12,41 @@
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.name' | translate}} </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.name }}&nbsp;&nbsp;
<fa-icon icon="question-circle" matTooltip="{{ configuration.description === undefined ? 'No Description' : configuration.description }}" matTooltipPosition="right"></fa-icon>
<fa-icon icon="question-circle" matTooltip="{{ getTooltip(configuration.description) | translate }}" matTooltipPosition="right"></fa-icon>
</td>
</ng-container>
<ng-container matColumnDef="enabled">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Status </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Status' | translate}} </th>
<td mat-cell *matCellDef="let configuration">
<mat-slide-toggle [(ngModel)]="configuration.enabled" name="{{configuration.name}}" (click)="toggleStatus(configuration)">
<div [className]="configuration.enabled ? 'enabled' : 'disabled'">
<span *ngIf="configuration.enabled">Enabled</span>
<span *ngIf="!configuration.enabled">Disabled</span>
<span *ngIf="configuration.enabled">{{'labels.inputs.Enabled' | translate}}</span>
<span *ngIf="!configuration.enabled">{{'labels.inputs.Disabled' | translate}}</span>
</div>
</mat-slide-toggle>
</td>
</ng-container>
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Value' | translate}} </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }}</td>
</ng-container>
<ng-container matColumnDef="stringValue">
<th mat-header-cell *matHeaderCellDef mat-sort-header> String Value </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.String Value' | translate}} </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.stringValue }}</td>
</ng-container>
<ng-container matColumnDef="dateValue">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Date Value </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Date Value' | translate}} </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.dateValue | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef> Edit </th>
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Edit' | translate}} </th>
<td mat-cell *matCellDef="let configuration">
<button mat-button color="primary" [routerLink]="[configuration.id, 'edit']">
<fa-icon icon="edit"></fa-icon>
@@ -66,19 +66,19 @@
</div>
<ng-template #templateFilter let-data let-popover="popover">
<h4>Search bar to filter configurations.</h4>
<h4>{{'labels.heading.Search bar to filter configurations' | translate}}</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateConfigurationsTable, configurationsTable, 'top', true)">Next</button>
<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>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateConfigurationsTable, configurationsTable, 'top', true)">{{'labels.buttons.Next' | translate}}</button>
</div>
</ng-template>
<ng-template #templateConfigurationsTable let-data let-popover="popover">
<h4 class="mw300">Global Configuration options and their current status. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895362/Global+Configuration" target="_blank">Global Configurations</a></h4>
<h4 class="mw300">{{'labels.heading.Global Configuration options' | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895362/Global+Configuration" target="_blank">{{'labels.inputs.Global Configurations' | 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()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true)">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
<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>
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{'labels.buttons.Next' | translate}}</button>
</div>
</ng-template>
@@ -148,4 +148,12 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
this.configurationWizardService.showConfigurations = true;
this.router.navigate(['/system']);
}
getTooltip(description: string): string {
if (description === undefined) {
return description;
}
return 'labels.text.No Description';
}
}