fixed translations in list component

This commit is contained in:
grata
2023-05-07 11:17:11 +02:00
parent 4bd18c6d62
commit 509e2069e6
3 changed files with 17 additions and 10 deletions

View File

@@ -1,14 +1,18 @@
<div *ngIf="isNear" class="container"> <div *ngIf="isNear" class="container">
<h1> <h1>
{{translations.locationName}}{{locationParams}} {{translations.locationName}}: {{locationParams}}
</h1> </h1>
<div *ngFor="let locations of locations, let i = index" class="row"> <div class="container2">
<h3> <div class="left">
<a class="link link-primary" href="location/{{locations.location}}">{{locations.location}}</a> <div *ngFor="let locations of locations, let i = index" class="row">
</h3> <h3>
<div> <a class="link link-primary" href="location/{{locations.location}}">{{locations.location}}</a>
<h4 *ngIf="locations.distance && !positionNotFound">{{translations.distance}}{{locations.distance}} km</h4> </h3>
<h4 *ngIf="positionNotFound">{{translations.positionNotFoundErrorMessage}}</h4> <div class="distance">
<h4 *ngIf="locations.distance && !positionNotFound">{{translations.distance}}{{locations.distance}} km</h4>
<h4 *ngIf="positionNotFound">{{translations.positionNotFoundErrorMessage}}</h4>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -9,6 +9,7 @@ import {WaypointService} from "../../service/http/waypoint.service"
import {cookieService} from "../../service/cookie.service"; import {cookieService} from "../../service/cookie.service";
import {UserService} from "../../service/http/user.service"; import {UserService} from "../../service/http/user.service";
import {WaypointVisitedService} from "../../service/http/waypointVisited.service"; import {WaypointVisitedService} from "../../service/http/waypointVisited.service";
import {ReadTranslateJsonService} from "../../service/language/readTranslateJson.service";
@Component({ @Component({
selector: 'app-list', selector: 'app-list',
@@ -42,10 +43,12 @@ export class ListComponent implements OnInit, OnChanges {
private waypointVisitedService: WaypointVisitedService, private waypointVisitedService: WaypointVisitedService,
private userService: UserService, private userService: UserService,
private cookieService: cookieService, private cookieService: cookieService,
private readTranslationJsonService: ReadTranslateJsonService,
) { ) {
} }
async ngOnInit() { async ngOnInit() {
this.translations = this.readTranslationJsonService.getListTransaltions();
this.username = this.cookieService.getUsername(); this.username = this.cookieService.getUsername();
this.route.params.subscribe(params => { this.route.params.subscribe(params => {
this.locationParams = params['location']; this.locationParams = params['location'];

View File

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