Unverified Commit bd6f7712 authored by Denys Butenko's avatar Denys Butenko
Browse files

NAS-112713: Replace T-marker with translate.instant

parent 2ef5f682
Showing with 94 additions and 109 deletions
+94 -109
......@@ -6,7 +6,6 @@ import {
} from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter } from 'rxjs/operators';
......@@ -44,11 +43,11 @@ export class JobsManagerComponent implements OnInit {
emptyConfig: EmptyConfig = {
type: EmptyType.NoPageData,
large: false,
title: T('No jobs are available.'),
title: this.translate.instant('No jobs are available.'),
icon: 'assignment',
message: T('Click the button below to see all jobs.'),
message: this.translate.instant('Click the button below to see all jobs.'),
button: {
label: T('History'),
label: this.translate.instant('History'),
action: this.goToJobs.bind(this),
},
};
......@@ -93,7 +92,7 @@ export class JobsManagerComponent implements OnInit {
this.dialogRef.close();
let title = job.description ? job.description : job.method;
if (job.state === JobState.Running) {
title = this.translate.instant(T('Updating'));
title = this.translate.instant('Updating');
}
const dialogRef = this.matDialog.open(EntityJobComponent, {
data: { title },
......
import { Component, OnInit } from '@angular/core';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { PoolScanFunction } from 'app/enums/pool-scan-function.enum';
......@@ -20,9 +19,9 @@ export class ResilverProgressDialogComponent implements OnInit {
progressTotalPercent = 0;
state: PoolScanState;
resilveringDetails: ResilverData;
title = T('Resilvering Status');
description = T('Resilvering pool: ');
statusLabel = T('Status: ');
title = this.translate.instant('Resilvering Status');
description = this.translate.instant('Resilvering pool: ');
statusLabel = this.translate.instant('Status: ');
diskName: string;
readonly PoolScanState = PoolScanState;
......
......@@ -5,7 +5,6 @@ import { MediaObserver } from '@angular/flex-layout';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatSidenav } from '@angular/material/sidenav';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { Observable, Subject, Subscription } from 'rxjs';
......@@ -363,10 +362,10 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
if (!isEulaAccepted || window.localStorage.getItem('upgrading_status') === 'upgrading') {
this.ws.call('truenas.get_eula').pipe(untilDestroyed(this)).subscribe((eula) => {
this.dialogService.confirm({
title: T('End User License Agreement - TrueNAS'),
title: this.translate.instant('End User License Agreement - TrueNAS'),
message: eula,
hideCheckBox: true,
buttonMsg: T('I Agree'),
buttonMsg: this.translate.instant('I Agree'),
hideCancel: true,
}).pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
window.localStorage.removeItem('upgrading_status');
......@@ -451,7 +450,7 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
title: network_interfaces_helptext.pending_changes_title,
message: network_interfaces_helptext.pending_changes_message,
hideCheckBox: true,
buttonMsg: T('Continue'),
buttonMsg: this.translate.instant('Continue'),
}).pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
this.router.navigate(['/network']);
});
......@@ -558,12 +557,12 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
upgradePendingDialog(): void {
this.dialogService.confirm({
title: T('Pending Upgrade'),
message: T('There is an upgrade waiting to finish.'),
title: this.translate.instant('Pending Upgrade'),
message: this.translate.instant('There is an upgrade waiting to finish.'),
hideCheckBox: true,
buttonMsg: T('Continue'),
buttonMsg: this.translate.instant('Continue'),
}).pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
const dialogRef = this.dialog.open(EntityJobComponent, { data: { title: T('Update') } });
const dialogRef = this.dialog.open(EntityJobComponent, { data: { title: this.translate.instant('Update') } });
dialogRef.componentInstance.setCall('failover.upgrade_finish');
dialogRef.componentInstance.disableProgressValue(true);
dialogRef.componentInstance.submit();
......@@ -611,10 +610,10 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
: helptext.updateRunning_dialog.message + helptext.updateRunning_dialog.message_pt2;
this.dialogService.confirm({
message,
title: helptext.updateRunning_dialog.title,
message: this.translate.instant(message),
title: this.translate.instant(helptext.updateRunning_dialog.title),
hideCheckBox: true,
buttonMsg: T('Close'),
buttonMsg: this.translate.instant('Close'),
hideCancel: true,
});
}
......@@ -800,7 +799,7 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
openChangePasswordDialog(): void {
const conf: DialogFormConfiguration = {
title: T('Change Password'),
title: this.translate.instant('Change Password'),
message: helptext.changePasswordDialog.pw_form_title_name,
fieldConfig: [
{
......@@ -828,7 +827,7 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
validation: [matchOtherValidator('password')],
},
],
saveButtonText: T('Save'),
saveButtonText: this.translate.instant('Save'),
custActions: [],
parent: this,
customSubmit: (entityDialog: EntityDialogComponent) => {
......@@ -841,10 +840,10 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
delete pwChange.curr_password;
this.ws.call('user.update', [1, pwChange]).pipe(untilDestroyed(this)).subscribe(() => {
this.loader.close();
this.dialogService.info(T('Success'), helptext.changePasswordDialog.pw_updated, '300px', 'info', false);
this.dialogService.info(this.translate.instant('Success'), helptext.changePasswordDialog.pw_updated, '300px', 'info', false);
}, (res) => {
this.loader.close();
this.dialogService.info(T('Error'), res, '300px', 'warning', false);
this.dialogService.info(this.translate.instant('Error'), res, '300px', 'warning', false);
});
} else {
this.loader.close();
......@@ -852,7 +851,7 @@ export class TopbarComponent extends ViewControllerComponent implements OnInit,
}
}, (res) => {
this.loader.close();
this.dialogService.info(T('Error'), res, '300px', 'warning', false);
this.dialogService.info(this.translate.instant('Error'), res, '300px', 'warning', false);
});
},
};
......
import { Component } from '@angular/core';
import { MatCheckboxChange } from '@angular/material/checkbox';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { filter } from 'rxjs/operators';
......@@ -51,7 +50,7 @@ export class GroupListComponent implements EntityTableConfig<Group> {
paging: true,
sorting: { columns: this.columns },
deleteMsg: {
title: T('Group'),
title: this.translate.instant('Group'),
key_props: ['group'],
},
};
......
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -197,10 +196,10 @@ export class UserListComponent implements EntityTableConfig<UserListRow> {
});
users.forEach((user) => {
user.details = [];
user.details.push({ label: T('GID'), value: user.group['bsdgrp_gid'] },
{ label: T('Home Directory'), value: user.home },
{ label: T('Shell'), value: user.shell },
{ label: T('Email'), value: user.email });
user.details.push({ label: this.translate.instant('GID'), value: user.group['bsdgrp_gid'] },
{ label: this.translate.instant('Home Directory'), value: user.home },
{ label: this.translate.instant('Shell'), value: user.shell },
{ label: this.translate.instant('Email'), value: user.email });
});
});
if (this.prefService.preferences.hide_builtin_users) {
......
......@@ -4,7 +4,6 @@ import {
import { MatDialog } from '@angular/material/dialog';
import { MatDialogRef } from '@angular/material/dialog/dialog-ref';
import { Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -514,7 +513,7 @@ export class ChartReleasesComponent implements OnInit {
title: helptext.podConsole.nopod.title,
message: helptext.podConsole.nopod.message,
hideCheckBox: true,
buttonMsg: T('Close'),
buttonMsg: this.translate.instant('Close'),
hideCancel: true,
});
} else {
......@@ -553,7 +552,7 @@ export class ChartReleasesComponent implements OnInit {
title: helptext.podConsole.nopod.title,
message: helptext.podConsole.nopod.message,
hideCheckBox: true,
buttonMsg: T('Close'),
buttonMsg: this.translate.instant('Close'),
hideCancel: true,
});
} else {
......
......@@ -4,7 +4,6 @@ import {
} from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -92,7 +91,7 @@ export class PodLogsComponent implements OnInit, OnDestroy {
title: helptext.podLogs.nopod.title,
message: helptext.podLogs.nopod.message,
hideCheckBox: true,
buttonMsg: T('Close'),
buttonMsg: this.translate.instant('Close'),
hideCancel: true,
});
}
......
......@@ -2,8 +2,8 @@ import {
Component,
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
import { Observable, Subject, Subscriber } from 'rxjs';
import helptext from 'app/helptext/shell/shell';
......@@ -33,6 +33,7 @@ export class PodShellComponent implements TerminalConfiguration {
private ws: WebSocketService,
private dialogService: DialogService,
private aroute: ActivatedRoute,
private translate: TranslateService,
) {}
preInit(): Observable<void> {
......@@ -51,7 +52,7 @@ export class PodShellComponent implements TerminalConfiguration {
title: helptext.podConsole.nopod.title,
message: helptext.podConsole.nopod.message,
hideCheckBox: true,
buttonMsg: T('Close'),
buttonMsg: this.translate.instant('Close'),
hideCancel: true,
});
} else {
......
import { Component, Output, EventEmitter } from '@angular/core';
import { MatCheckboxChange } from '@angular/material/checkbox/checkbox';
import { MatDialogRef } from '@angular/material/dialog';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import { ApiMethod } from 'app/interfaces/api-directory.interface';
......@@ -13,8 +12,8 @@ import { ApiMethod } from 'app/interfaces/api-directory.interface';
export class ConfirmDialogComponent {
title: string;
message: string;
buttonMsg: string = T('Continue');
cancelMsg: string = T('Cancel');
buttonMsg: string = this.translate.instant('Continue');
cancelMsg: string = this.translate.instant('Cancel');
hideCheckBox = false;
isSubmitEnabled = false;
secondaryCheckBox = false;
......
import { Component, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslateService } from '@ngx-translate/core';
import {
TREE_ACTIONS, KEYS, IActionMapping, TreeNode, ITreeOptions,
......@@ -38,7 +37,7 @@ export class FormExplorerComponent implements Field, OnInit {
},
click: (tree, node, $event) => {
if (node.isRoot && !this.rootSelectable) {
this.config.warnings = T('Root node is not a valid value');
this.config.warnings = this.translate.instant('Root node is not a valid value');
return;
}
this.config.warnings = null;
......
......@@ -5,7 +5,6 @@ import {
} from '@angular/core';
import { FormGroup, FormControl, AbstractControl } from '@angular/forms';
import { MatMonthView } from '@angular/material/datepicker';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as parser from 'cron-parser';
......@@ -199,33 +198,33 @@ export class FormSchedulerComponent implements Field, OnInit, AfterViewInit, Aft
}
customOption: CronPreset = {
label: T('Custom'),
label: this.translate.instant('Custom'),
value: this.crontab,
description: T('Create custom schedule'),
description: this.translate.instant('Create custom schedule'),
};
selectedOption: CronPreset;
presets: CronPreset[] = [
{
label: T('Hourly'),
label: this.translate.instant('Hourly'),
value: '0 * * * *',
description: T('at the start of each hour'),
description: this.translate.instant('at the start of each hour'),
},
{
label: T('Daily'),
label: this.translate.instant('Daily'),
value: '0 0 * * *',
description: T('at 00:00 (12:00 AM)'),
description: this.translate.instant('at 00:00 (12:00 AM)'),
},
{
label: T('Weekly'),
label: this.translate.instant('Weekly'),
value: '0 0 * * sun',
description: T('on Sundays at 00:00 (12:00 AM)'),
description: this.translate.instant('on Sundays at 00:00 (12:00 AM)'),
},
{
label: T('Monthly'),
label: this.translate.instant('Monthly'),
value: '0 0 1 * *',
description: T('on the first day of the month at 00:00 (12:00 AM)'),
description: this.translate.instant('on the first day of the month at 00:00 (12:00 AM)'),
},
];
......@@ -255,7 +254,7 @@ export class FormSchedulerComponent implements Field, OnInit, AfterViewInit, Aft
if (!p.value) {
this.crontab = '0 0 * * *';
this.convertPreset('0 0 * * *');
this._preset = this.customOption; // { label: T('Custom'), value: this.crontab };
this._preset = this.customOption; // { label: this.translate.instant('Custom'), value: this.crontab };
} else {
this.crontab = p.value;
this.convertPreset(p.value);
......
......@@ -4,7 +4,6 @@ import {
import { AbstractControl, FormGroup } from '@angular/forms';
import { MatFormField } from '@angular/material/form-field';
import { MatSelect, MatSelectChange } from '@angular/material/select';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -136,17 +135,17 @@ export class FormSelectComponent implements Field, AfterViewInit, AfterViewCheck
if (!this.shouldAlertOnOption(option) || this.disableAlert) return;
const conf: DialogFormConfiguration = {
title: T('Alert'),
title: this.translate.instant('Alert'),
message: this.config.alert.message,
hideCancel: true,
fieldConfig: [
{
type: 'checkbox',
name: 'disable_alert',
placeholder: T('Don\'t show this message again'),
placeholder: this.translate.instant('Don\'t show this message again'),
},
],
saveButtonText: T('OK'),
saveButtonText: this.translate.instant('OK'),
customSubmit: (entityDialog: EntityDialogComponent) => {
entityDialog.dialogRef.close(true);
if (entityDialog.formValue.disable_alert) {
......
......@@ -3,7 +3,6 @@ import {
} from '@angular/common/http';
import { Component, ViewChild, ElementRef } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { Subscription, Observer } from 'rxjs';
......@@ -72,15 +71,15 @@ export class FormUploadComponent {
if (event.statusText === 'OK') {
this.newMessage(location + '/' + fileBrowser.files[0].name);
this.loader.close();
this.dialog.info(T('File upload complete'), '', '300px', 'info', true);
this.dialog.info(this.translate.instant('File upload complete'), '', '300px', 'info', true);
}
}
}, (error) => {
this.loader.close();
this.dialog.errorReport(T('Error'), error.statusText, error.message);
this.dialog.errorReport(this.translate.instant('Error'), error.statusText, error.message);
});
} else {
this.dialog.info(T('Please make sure to select a file'), '', '300px', 'info', true);
this.dialog.info(this.translate.instant('Please make sure to select a file'), '', '300px', 'info', true);
}
}
......
......@@ -17,7 +17,6 @@ import {
FormBuilder, FormControl, FormGroup, NgForm,
} from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -94,7 +93,7 @@ export class EntityFormEmbeddedComponent implements OnInit, OnDestroy, AfterView
fieldSets: FieldSet[];
fieldConfig: FieldConfig[];
hasConf = true;
saveSubmitText: string = T('Save');
saveSubmitText: string = this.translate.instant('Save');
saveSubmitStatus = '';
actionButtonsAlign = 'center';
......
......@@ -15,7 +15,6 @@ import {
FormBuilder, FormControl, FormGroup, FormArray, AbstractControl,
} from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -59,9 +58,9 @@ export class EntityFormComponent implements OnInit, OnDestroy, OnChanges, AfterV
wsfg: AbstractControl;
wsResponseIdx: any;
queryResponse: any;
saveSubmitText: string = T('Save');
saveSubmitText: string = this.translate.instant('Save');
showPassword = false;
successMessage: string = T('Settings saved.');
successMessage: string = this.translate.instant('Settings saved.');
loaderOpen = false;
keepLoaderOpen = false;
......@@ -247,7 +246,7 @@ export class EntityFormComponent implements OnInit, OnDestroy, OnChanges, AfterV
}
} else {
if (this.conf.saveSubmitText === undefined) {
this.saveSubmitText = T('Save');
this.saveSubmitText = this.translate.instant('Save');
}
if (this.conf.addCall) {
this.submitFunction = this.addCall;
......@@ -446,7 +445,7 @@ export class EntityFormComponent implements OnInit, OnDestroy, OnChanges, AfterV
: false,
buttonMsg: this.conf.confirmSubmitDialog.hasOwnProperty('button')
? this.conf.confirmSubmitDialog['button']
: T('Ok'),
: this.translate.instant('Ok'),
}).pipe(filter(Boolean), untilDestroyed(this)).subscribe(() => {
this.doSubmit(event);
});
......
......@@ -20,7 +20,6 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { NavigationStart, Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -460,8 +459,8 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
break;
case EmptyType.NoSearchResults:
title = T('No Search Results.');
message = T('Your query didn\'t return any results. Please try again.');
title = this.translate.instant('No Search Results.');
message = this.translate.instant('Your query didn\'t return any results. Please try again.');
if (this.conf.emptyTableConfigMessages && this.conf.emptyTableConfigMessages.no_search_results) {
title = this.conf.emptyTableConfigMessages.no_search_results.title;
message = this.conf.emptyTableConfigMessages.no_search_results.message;
......@@ -475,10 +474,10 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
break;
case EmptyType.Errors:
title = T('Something went wrong');
title = this.translate.instant('Something went wrong');
if (error) {
message = T('The system returned the following error - ');
message = this.translate.instant('The system returned the following error - ');
}
if (this.conf.emptyTableConfigMessages && this.conf.emptyTableConfigMessages.errors) {
......@@ -514,7 +513,7 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
item: this.title,
});
}
let buttonText = T('Add ') + this.title;
let buttonText = this.translate.instant('Add ') + this.title;
if (this.conf.emptyTableConfigMessages && this.conf.emptyTableConfigMessages.buttonText) {
buttonText = this.conf.emptyTableConfigMessages.buttonText;
}
......@@ -547,7 +546,7 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
item: this.title,
});
}
let buttonText = T('Add ') + this.title;
let buttonText = this.translate.instant('Add ') + this.title;
if (this.conf.emptyTableConfigMessages && this.conf.emptyTableConfigMessages.buttonText) {
buttonText = this.conf.emptyTableConfigMessages.buttonText;
}
......@@ -805,13 +804,13 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
name: 'edit',
id: 'edit',
icon: 'edit',
label: T('Edit'),
label: this.translate.instant('Edit'),
onClick: (rowinner: any) => { this.doEdit(rowinner.id); },
}, {
name: 'delete',
id: 'delete',
icon: 'delete',
label: T('Delete'),
label: this.translate.instant('Delete'),
onClick: (rowinner: any) => { this.doDelete(rowinner); },
}] as EntityTableAction[];
}
......@@ -854,8 +853,8 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
}
// generate delete msg
getDeleteMessage(item: any, action: string = T('Delete ')): string {
let deleteMsg: string = T('Delete the selected item?');
getDeleteMessage(item: any, action: string = this.translate.instant('Delete ')): string {
let deleteMsg: string = this.translate.instant('Delete the selected item?');
if (this.conf.config.deleteMsg) {
deleteMsg = action + this.conf.config.deleteMsg.title;
let msg_content = ' <b>' + item[this.conf.config.deleteMsg.key_props[0]];
......@@ -907,10 +906,10 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
});
} else {
this.dialogService.confirm({
title: dialog.hasOwnProperty('title') ? dialog['title'] : T('Delete'),
title: dialog.hasOwnProperty('title') ? dialog['title'] : this.translate.instant('Delete'),
message: dialog.hasOwnProperty('message') ? dialog['message'] + deleteMsg : deleteMsg,
hideCheckBox: dialog.hasOwnProperty('hideCheckbox') ? dialog['hideCheckbox'] : false,
buttonMsg: dialog.hasOwnProperty('button') ? dialog['button'] : T('Delete'),
buttonMsg: dialog.hasOwnProperty('button') ? dialog['button'] : this.translate.instant('Delete'),
}).pipe(untilDestroyed(this)).subscribe((res) => {
if (res) {
this.toDeleteRow = item;
......@@ -956,10 +955,10 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
return this.dialogService
.confirm({
title: dialog.hasOwnProperty('title') ? dialog['title'] : T('Delete'),
title: dialog.hasOwnProperty('title') ? dialog['title'] : this.translate.instant('Delete'),
message: dialog.hasOwnProperty('message') ? dialog['message'] + deleteMsg : deleteMsg,
hideCheckBox: dialog.hasOwnProperty('hideCheckbox') ? dialog['hideCheckbox'] : false,
buttonMsg: dialog.hasOwnProperty('button') ? dialog['button'] : T('Delete'),
buttonMsg: dialog.hasOwnProperty('button') ? dialog['button'] : this.translate.instant('Delete'),
})
.pipe(
filter(Boolean),
......@@ -1020,7 +1019,7 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
title: 'Delete',
message: multiDeleteMsg,
hideCheckBox: false,
buttonMsg: T('Delete'),
buttonMsg: this.translate.instant('Delete'),
}).pipe(untilDestroyed(this)).subscribe((res) => {
if (!res) {
return;
......@@ -1050,10 +1049,10 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
}
}
if (message === '') {
this.dialogService.info(T('Items deleted'), '', '300px', 'info', true);
this.dialogService.info(this.translate.instant('Items deleted'), '', '300px', 'info', true);
} else {
message = '<ul>' + message + '</ul>';
this.dialogService.errorReport(T('Items Delete Failed'), message);
this.dialogService.errorReport(this.translate.instant('Items Delete Failed'), message);
}
}
},
......@@ -1169,7 +1168,7 @@ export class EntityTableComponent<Row = any> implements OnInit, AfterViewInit, A
}
runningStateButton(jobid: number): void {
const dialogRef = this.matDialog.open(EntityJobComponent, { data: { title: T('Task is running') } });
const dialogRef = this.matDialog.open(EntityJobComponent, { data: { title: this.translate.instant('Task is running') } });
dialogRef.componentInstance.jobId = jobid;
dialogRef.componentInstance.wsshow();
dialogRef.componentInstance.success.pipe(untilDestroyed(this)).subscribe(() => {
......
......@@ -7,7 +7,6 @@ import {
} from '@angular/forms';
import { MatStep, MatStepper } from '@angular/material/stepper';
import { Router, ActivatedRoute } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
......@@ -37,8 +36,8 @@ export class EntityWizardComponent implements OnInit {
summaryValue: any;
summaryFieldConfigs: FieldConfig[] = [];
saveSubmitText: string = T('Save');
customNextText = T('Next');
saveSubmitText: string = this.translate.instant('Save');
customNextText = this.translate.instant('Next');
get formArray(): AbstractControl | null { return this.formGroup.get('formArray'); }
constructor(
......@@ -189,7 +188,7 @@ export class EntityWizardComponent implements OnInit {
} else if (this.conf.route_success) {
this.router.navigate(new Array('/').concat(this.conf.route_success));
} else {
this.dialog.info(T('Settings saved'), '', '300px', 'info', true);
this.dialog.info(this.translate.instant('Settings saved'), '', '300px', 'info', true);
}
},
(res) => {
......
import { Component } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import globalHelptext from 'app/helptext/global-helptext';
......@@ -17,8 +16,8 @@ export class PasswordDialogComponent {
title: string = globalHelptext.rootpw.dialog_title;
message: string;
placeholder = globalHelptext.rootpw.placeholder;
buttonMsg: string = T('Continue');
cancelMsg: string = T('Cancel');
buttonMsg: string = this.translate.instant('Continue');
cancelMsg: string = this.translate.instant('Cancel');
hideCheckBox = false;
method: string;
data: string;
......
import { Component, OnInit } from '@angular/core';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum';
......@@ -66,8 +65,8 @@ export class BackupCredentialsComponent implements OnInit {
deleteCall: 'cloudsync.credentials.delete',
name: 'cloudCreds',
columns: [
{ name: T('Name'), prop: 'name' },
{ name: T('Provider'), prop: 'provider' },
{ name: this.translate.instant('Name'), prop: 'name' },
{ name: this.translate.instant('Provider'), prop: 'provider' },
],
hideHeader: false,
parent: this,
......@@ -88,7 +87,7 @@ export class BackupCredentialsComponent implements OnInit {
name: 'sshConnections',
dataSourceHelper: this.sshConnectionsDataSourceHelper,
columns: [
{ name: T('Name'), prop: 'name' },
{ name: this.translate.instant('Name'), prop: 'name' },
],
hideHeader: true,
parent: this,
......@@ -109,7 +108,7 @@ export class BackupCredentialsComponent implements OnInit {
getActions: this.sshKeyPairActions.bind(this),
dataSourceHelper: this.sshKeyPairsDataSourceHelper,
columns: [
{ name: T('Name'), prop: 'name' },
{ name: this.translate.instant('Name'), prop: 'name' },
],
hideHeader: true,
parent: this,
......
import { Component } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateService } from '@ngx-translate/core';
import * as _ from 'lodash';
import { take } from 'rxjs/operators';
import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum';
......@@ -86,7 +86,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
type: 'button',
name: 'oauth_signin_button',
isHidden: true,
customEventActionLabel: T('Log in to Provider'),
customEventActionLabel: this.translate.instant('Log in to Provider'),
value: '',
customEventMethod: () => {
this.logInToProvider();
......@@ -955,7 +955,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
{
type: 'checkbox',
name: 'advanced-S3',
placeholder: T('Advanced Settings'),
placeholder: this.translate.instant('Advanced Settings'),
isHidden: true,
value: false,
relation: [
......@@ -1235,7 +1235,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
custActions = [
{
id: 'validCredential',
name: T('Verify Credential'),
name: this.translate.instant('Verify Credential'),
buttonColor: 'default',
function: () => {
this.entityForm.loader.open();
......@@ -1269,7 +1269,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
},
}, {
id: 'customSave',
name: T('Save'),
name: this.translate.instant('Save'),
buttonType: 'submit',
buttonColor: 'primary',
},
......@@ -1284,6 +1284,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
protected dialog: DialogService,
protected replicationService: ReplicationService,
private modalService: ModalService,
protected translate: TranslateService,
) {
this.modalService.getRow$
.pipe(take(1), untilDestroyed(this))
......@@ -1437,7 +1438,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
(res) => {
this.entityForm.loader.close();
if (res.valid) {
this.dialog.info(T('Valid'), T('The Credential is valid.'), '500px', 'info');
this.dialog.info(this.translate.instant('Valid'), this.translate.instant('The Credential is valid.'), '500px', 'info');
} else {
this.dialog.errorReport('Error', res.excerpt, res.error);
}
......@@ -1453,6 +1454,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
window.open(this.oauthURL + '?origin=' + encodeURIComponent(window.location.toString()), '_blank', 'width=640,height=480');
const controls = this.entityForm.formGroup.controls;
const dialogService = this.dialog;
const translate = this.translate;
const getOnedriveList = this.getOnedriveList.bind(this);
const method = (message: OauthMessage): void => doAuth(message, this.selectedProvider);
......@@ -1462,7 +1464,7 @@ export class CloudCredentialsFormComponent implements FormConfiguration {
function doAuth(message: OauthMessage, selectedProvider: string): void {
if ('oauth_portal' in message.data) {
if (message.data.error) {
dialogService.errorReport(T('Error'), message.data.error);
dialogService.errorReport(translate.instant('Error'), message.data.error);
} else {
for (const prop in message.data.result) {
let targetProp = prop;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment