adding i18n to loading and errror messages (wip)

This commit is contained in:
William Welling
2017-10-05 05:59:01 -05:00
parent 88ec5e8db9
commit 5b45871bff
7 changed files with 46 additions and 24 deletions

View File

@@ -78,5 +78,25 @@
"results": {
"title": "Search Results"
}
},
"loader": {
"default": "Loading...",
"top-level-communities": "Loading top level communities...",
"community": "Loading community...",
"collection": "Loading collection...",
"sub-collection": "Loading sub-collections...",
"items": "Loading items...",
"item": "Loading item...",
"object-list": "Loading..."
},
"error": {
"default": "Error...",
"top-level-communities": "Error fetching top level communities",
"community": "Error fetching community",
"collection": "Error fetching collection",
"sub-collection": "Error fetching sub-collections",
"items": "Error fetching items",
"item": "Error fetching item",
"object-list": "Error fetching"
}
}

View File

@@ -9,5 +9,5 @@
</li>
</ul>
</div>
<ds-error *ngIf="subCollections.hasFailed | async" message="Error fetching sub collections"></ds-error>
<ds-loading *ngIf="subCollections.isLoading | async" message="Loading sub collections..."></ds-loading>
<ds-error *ngIf="subCollections.hasFailed | async" message="Error fetching sub-collections"></ds-error>
<ds-loading *ngIf="subCollections.isLoading | async" message="Loading sub-collections..."></ds-loading>

View File

@@ -1,21 +1,23 @@
<div class="item-page" *ngIf="item.hasSucceeded | async" @fadeInOut>
<ds-item-page-title-field [item]="item.payload | async"></ds-item-page-title-field>
<div class="simple-view-link">
<a class="btn btn-outline-primary col-4" [routerLink]="['/items/' + (item.payload | async)?.id]">
{{"item.page.link.simple" | translate}}
</a>
<div *ngIf="item.payload | async; let itemPayload">
<ds-item-page-title-field [item]="itemPayload | async"></ds-item-page-title-field>
<div class="simple-view-link">
<a class="btn btn-outline-primary col-4" [routerLink]="['/items/' + itemPayload.id]">
{{"item.page.link.simple" | translate}}
</a>
</div>
<table class="table table-responsive table-striped">
<tbody>
<tr *ngFor="let metadatum of (metadata | async)">
<td>{{metadatum.key}}</td>
<td>{{metadatum.value}}</td>
<td>{{metadatum.language}}</td>
</tr>
</tbody>
</table>
<ds-item-page-full-file-section [item]="itemPayload"></ds-item-page-full-file-section>
<ds-item-page-collections [item]="itemPayload"></ds-item-page-collections>
</div>
<table class="table table-responsive table-striped">
<tbody>
<tr *ngFor="let metadatum of (metadata | async)">
<td>{{metadatum.key}}</td>
<td>{{metadatum.value}}</td>
<td>{{metadatum.language}}</td>
</tr>
</tbody>
</table>
<ds-item-page-full-file-section [item]="item.payload | async"></ds-item-page-full-file-section>
<ds-item-page-collections [item]="item.payload | async"></ds-item-page-collections>
</div>
<ds-error *ngIf="item.hasFailed | async" message="Error fetching item"></ds-error>
<ds-loading *ngIf="item.isLoading | async" message="Loading item..."></ds-loading>

View File

@@ -1,3 +1,3 @@
<div>
<span>{{ message }}</span>
<label>{{ message }}</label>
</div>

View File

@@ -22,8 +22,8 @@ describe('ErrorComponent (inline template)', () => {
comp = fixture.componentInstance; // ErrorComponent test instance
// query for the message <span> by CSS element selector
de = fixture.debugElement.query(By.css('span'));
// query for the message <label> by CSS element selector
de = fixture.debugElement.query(By.css('label'));
el = de.nativeElement;
});

View File

@@ -1,5 +1,5 @@
<div>
<span>{{ message }}</span>
<label>{{ message }}</label>
<div class="loader">
<span class="l-1"></span>
<span class="l-2"></span>

View File

@@ -22,8 +22,8 @@ describe('LoadingComponent (inline template)', () => {
comp = fixture.componentInstance; // LoadingComponent test instance
// query for the message <span> by CSS element selector
de = fixture.debugElement.query(By.css('span'));
// query for the message <label> by CSS element selector
de = fixture.debugElement.query(By.css('label'));
el = de.nativeElement;
});