added translation for new feature

This commit is contained in:
grata
2023-04-25 15:02:40 +02:00
parent 75833f4db4
commit 95e27510e2
5 changed files with 6 additions and 3 deletions

View File

@@ -10,5 +10,6 @@ export interface listTranslations {
translate: string;
locationName: string;
distance: string;
positionNotFoundErrorMessage: string;
}

View File

@@ -32,7 +32,7 @@
</h3>
<div class="distance">
<h4 *ngIf="distance[i]">{{translations.distance}}{{distance[i]}} km</h4>
<h4 *ngIf="positionNotFound">could not retrieve distance</h4>
<h4 *ngIf="positionNotFound">{{translations.positionNotFoundErrorMessage}}</h4>
</div>
</div>

View File

@@ -121,6 +121,6 @@ export class ListComponent implements OnInit, OnChanges {
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);
}
}

View File

@@ -24,6 +24,7 @@ export class ReadTranslateJsonService {
this.listTranslation.translate = data.translate;
this.listTranslation.distance = data.distance;
this.listTranslation.locationName = data.locationName;
this.listTranslation.positionNotFoundErrorMessage = data.positionNotFoundErrorMessage;
console.log("data loaded", this.homeTranslations)
});
}

View File

@@ -1,5 +1,6 @@
{
"translate": "Translate",
"locationName": "Position not found: ",
"distance": "Distance: "
"distance": "Distance: ",
"positionNotFoundErrorMessage": "Could not retrieve position"
}