Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Silviu Popa authored and Silviu Popa committed Sep 2, 2020
1 parent 8ea470a commit f8a30e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@
placeholder="{{processFilterProperty.label | translate}}"
(selectionChange)="onSelectionChange($event)"
[attr.data-automation-id]="'adf-cloud-edit-process-property-' + processFilterProperty.key">
<mat-option [value]="'all'"></mat-option>
<mat-option *ngFor="let propertyOption of options" [value]="propertyOption.key" [attr.data-automation-id]="'adf-cloud-edit-process-property-options-' + processFilterProperty.key">
{{ propertyOption.label }}
{{ propertyOption.label | translate }}
</mat-option>
</mat-select>
</mat-form-field>

<ng-container *ngIf="isDateRangeType()">
<mat-form-field class="adf-cloud-date-range-picker">
<mat-label>Enter a date range</mat-label>
<mat-label>{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE_TITLE' | translate }}</mat-label>
<mat-date-range-input [formGroup]="dateRangeForm" [rangePicker]="picker">
<input matStartDate formControlName="start" placeholder="Start date">
<input matEndDate formControlName="end" placeholder="End date">
</mat-date-range-input>
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-date-range-picker #picker (closed)="onDateRangeClosed($event)"></mat-date-range-picker>
<mat-date-range-picker #picker (closed)="onDateRangeClosed()"></mat-date-range-picker>

<mat-error *ngIf="dateRangeForm.controls.start.hasError('matStartDateInvalid')">Invalid start date</mat-error>
<mat-error *ngIf="dateRangeForm.controls.end.hasError('matEndDateInvalid')">Invalid end date</mat-error>
</mat-form-field>
<mat-error *ngIf="dateRangeForm.controls.start.hasError('matStartDateInvalid')">{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.ERROR.INDALID_START_DATE' | translate }}</mat-error>
<mat-error *ngIf="dateRangeForm.controls.end.hasError('matEndDateInvalid')">{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.ERROR.INDALID_END_DATE' | translate }}</mat-error>
</mat-form-field>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,27 @@ import { FormGroup, FormControl } from '@angular/forms';
options = [
{
key: ProcessDateFilterType.today,
label: 'today'
},
{
key: ProcessDateFilterType.today,
label: 'today'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.TODAY'
},
{
key: ProcessDateFilterType.week,
label: 'week'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.WEEK'
},
{
key: ProcessDateFilterType.month,
label: 'month'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.MONTH'
},
{
key: ProcessDateFilterType.quarter,
label: 'quarter'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.QUARTER'
},
{
key: ProcessDateFilterType.year,
label: 'year'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.YEAR'
},
{
key: ProcessDateFilterType.range,
label: 'Date within'
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE.RANGE'
}
];

Expand Down
18 changes: 16 additions & 2 deletions lib/process-services-cloud/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,24 @@
"LAST_MODIFIED_DATE_FORM": "LastModifiedFrom",
"LAST_MODIFIED_TO": "LastModifiedTo",
"PROCESS_NAME": "ProcessName",
"APP_VERSION": "AppReleaseVersion"
"APP_VERSION": "AppReleaseVersion",
"CREATED_DATE": "Created Date",
"DATE_RANGE": {
"TODAY": "today",
"WEEK": "this week",
"MONTH": "this month",
"QUARTER": "this quarter",
"YEAR": "this year",
"RANGE": "Date within"
},
"DATE_RANGE_TITLE": "Start date - End date",
"START_DATE": "Start date",
"END_DATE": "End date"
},
"ERROR": {
"DATE": "Date format DD/MM/YYYY"
"DATE": "Date format DD/MM/YYYY",
"INDALID_START_DATE": "Invalid start date",
"INDALID_END_DATE": "Invalid end date"
},
"TOOL_TIP": {
"SAVE": "Save filter",
Expand Down

0 comments on commit f8a30e2

Please sign in to comment.