Added i18n label

This commit is contained in:
Giuseppe Digilio
2018-12-27 16:09:15 +01:00
parent f592aba236
commit 5598af35ee
6 changed files with 43 additions and 39 deletions

View File

@@ -1,7 +1,9 @@
<div>
<div ngbDropdown #collectionControls="ngbDropdown" class="btn-group input-group" (openChange)="toggled($event)">
<div class="input-group-prepend">
<span id="collectionControlsMenuLabel" class="input-group-text">Collection</span>
<span id="collectionControlsMenuLabel" class="input-group-text">
{{ 'submission.sections.general.collection' | translate }}
</span>
</div>
<button aria-describedby="collectionControlsMenuLabel"
id="collectionControlsMenuButton"
@@ -10,25 +12,35 @@
(click)="onClose()"
[disabled]="disabled"
ngbDropdownToggle>
<span *ngIf="disabled"><i class='fa fa-circle-o-notch fa-spin'></i></span>
<span *ngIf="disabled"><i class='fas fa-circle-notch fa-spin'></i></span>
<span *ngIf="!disabled">{{ (selectedCollectionName) ? selectedCollectionName : '' }}</span>
</button>
<div ngbDropdownMenu class="dropdown-menu" id="collectionControlsDropdownMenu" aria-labelledby="collectionControlsMenuButton">
<div ngbDropdownMenu
class="dropdown-menu"
id="collectionControlsDropdownMenu"
aria-labelledby="collectionControlsMenuButton">
<div class="form-group w-100 pr-2 pl-2">
<input *ngIf="searchField"
type="search"
class="form-control w-100"
(click)="$event.stopPropagation();"
placeholder="Search for a collection"
placeholder="{{ 'submission.sections.general.search-collection' | translate }}"
[formControl]="searchField">
</div>
<div class="dropdown-divider"></div>
<div class="scrollable-menu" aria-labelledby="dropdownMenuButton" (scroll)="onScroll($event)">
<button class="dropdown-item disabled" *ngIf="(searchListCollection$ | async).length == 0">No results found</button>
<button class="dropdown-item collection-item" *ngFor="let listItem of (searchListCollection$ | async)" (click)="onSelect(listItem)" title="{{ listItem.collection.name }}">
<button class="dropdown-item disabled" *ngIf="(searchListCollection$ | async).length == 0">
{{'submission.sections.general.no-collection' | translate}}
</button>
<button *ngFor="let listItem of (searchListCollection$ | async)"
class="dropdown-item collection-item"
title="{{ listItem.collection.name }}"
(click)="onSelect(listItem)">
<ul class="list-unstyled mb-0">
<li class="list-item text-truncate text-secondary" *ngFor="let item of listItem.communities" >{{ item.name}} <i class="fa fa-level-down" aria-hidden="true"></i></li>
<li class="list-item text-truncate text-secondary" *ngFor="let item of listItem.communities" >
{{ item.name}} <i class="fa fa-level-down" aria-hidden="true"></i>
</li>
<li class="list-item text-truncate text-primary font-weight-bold">{{ listItem.collection.name}}</li>
</ul>
</button>

View File

@@ -26,7 +26,7 @@
<button *ngIf="(showDepositAndDiscard | async)"
type="button"
class="btn btn-primary"
[disabled]="submissionIsInvalid" (click)="deposit()">
[disabled]="(submissionIsInvalid | async)" (click)="deposit()">
<span>{{'submission.general.deposit' | translate}}</span>
</button>
</div>

View File

@@ -1,12 +1,21 @@
<div ngbDropdown #sectionAdd="ngbDropdown" placement="bottom-right" class="d-inline-block" [ngClass]="{'w-100': windowService.isXs()}">
<div ngbDropdown
#sectionAdd="ngbDropdown"
placement="bottom-right"
class="d-inline-block"
[ngClass]="{'w-100': windowService.isXs()}">
<button class="btn btn-outline-primary dropdown-toggle"
id="sectionControls"
[ngClass]="{'w-100': (windowService.isXs() | async)}"
ngbDropdownToggle>
{{'submission.sections.general.add-more' | translate}} <i class="fa fa-plus" aria-hidden="true"></i>
{{ 'submission.sections.general.add-more' | translate }} <i class="fa fa-plus" aria-hidden="true"></i>
</button>
<div ngbDropdownMenu class="sections-dropdown-menu" aria-labelledby="sectionControls" [ngClass]="{'w-100': (windowService.isXs() | async)}">
<button class="dropdown-item disabled" *ngIf="(sectionList | async)?.length == 0">No options available</button>
<div ngbDropdownMenu
class="sections-dropdown-menu"
aria-labelledby="sectionControls"
[ngClass]="{'w-100': (windowService.isXs() | async)}">
<button class="dropdown-item disabled" *ngIf="(sectionList | async)?.length == 0">
{{ 'submission.sections.general.no-sections' | translate }}
</button>
<button class="dropdown-item" *ngFor="let listItem of (sectionList | async)" (click)="addSection(listItem.id)">
{{'submission.sections.'+listItem.header | translate }}
</button>

View File

@@ -11,10 +11,10 @@
</ng-container>
<ng-container *ngIf="entry.value === ''">
<h5 *ngIf="metadata.indexOf(entry) === 0">
<span class="text-muted">No {{entry.key}}</span>
<span class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{entry.key}}</span>
</h5>
<ng-container *ngIf="metadata.indexOf(entry) !== 0">
<span class="text-muted">No {{entry.key}}</span>
<span class="text-muted">{{'submission.sections.upload.no-entry' | translate}} {{entry.key}}</span>
</ng-container>
</ng-container>
</ng-container>

View File

@@ -5,7 +5,7 @@
<ng-container *ngIf="fileList.length == 0">
<div class="row">
<div class="col-md-12">
<h3 class="text-center"><span class="text-muted">No file uploaded yet.</span></h3>
<h3 class="text-center"><span class="text-muted">{{'submission.sections.upload.no-file-uploaded' | translate}}</span></h3>
</div>
</div>
</ng-container>