Ajout des traductions
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
@@ -29,7 +30,8 @@ export class ListOfGearsComponent implements OnInit {
|
||||
|
||||
constructor(private serviceApi: GearService,
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog) {}
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
@@ -38,7 +40,13 @@ export class ListOfGearsComponent implements OnInit {
|
||||
this.getListOfGears();
|
||||
}
|
||||
});
|
||||
this.serviceComm.UpdatedComponentTitle("List of gears");
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
this.updateTitle();
|
||||
this.getListOfGears();
|
||||
}
|
||||
|
||||
@@ -60,4 +68,10 @@ export class ListOfGearsComponent implements OnInit {
|
||||
width: "600px"
|
||||
});
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("ListGears_Title").subscribe(
|
||||
data => { this.serviceComm.UpdatedComponentTitle(data); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user