Centralized translations

This commit is contained in:
grata
2023-05-05 11:35:33 +02:00
parent d072dca42c
commit ea70e73359
8 changed files with 67 additions and 80 deletions

View File

@@ -35,8 +35,6 @@ export class ListComponent implements OnInit, OnChanges {
constructor(
private route: ActivatedRoute,
private positionService: positionService,
private translateService: TranslateService,
private readTranslationJsonService: ReadTranslateJsonService,
private locationService: LocationService,
private waypointService: WaypointService,
private cookieService: cookieService,
@@ -44,7 +42,6 @@ export class ListComponent implements OnInit, OnChanges {
}
async ngOnInit() {
this.translations = this.readTranslationJsonService.getListTransaltions();
this.username = this.cookieService.getUsername();
this.route.params.subscribe(params => {
this.locationParams = params['location'];
@@ -96,13 +93,6 @@ export class ListComponent implements OnInit, OnChanges {
}, 2000);
}
async switchLanguage(lang: string) {
this.translations.translate = await this.translateService.getData(this.translations.translate, lang);
this.translations.distance = await this.translateService.getData(this.translations.distance, lang);
this.translations.locationName = await this.translateService.getData(this.translations.locationName, lang);
this.translations.positionNotFoundErrorMessage = await this.translateService.getData(this.translations.positionNotFoundErrorMessage, lang);
}
private checkDataPopulated(): void {
if (this.locations && this.location) {
console.log("Dati popolati correttamente:", this.locations, this.location);