Skip to content

Commit

Permalink
translations: fix missing translations
Browse files Browse the repository at this point in the history
- Closes rero/rero-ils#2276
- Closes rero/rero-ils#2752

Co-Authored-by: Pascal Repond <pascal.repond@rero.ch>
  • Loading branch information
PascalRepond committed Apr 28, 2022
1 parent 8e4f39a commit 3af6d42
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
<!-- ACQUISITION STATUS -->
<ng-container *ngIf="context === 'holdings' && holding.metadata.acquisition_status">
<div class="col-3 font-weight-bold" translate>Acquisition status</div>
<div class="col-9">{{ holding.metadata.acquisition_status }}</div>
<div class="col-9">{{ holding.metadata.acquisition_status | getTranslatedLabel : language }}</div>
</ng-container>

<!-- ACQUISITION METHOD -->
<ng-container *ngIf="context === 'holdings' && holding.metadata.acquisition_method">
<div class="col-3 font-weight-bold" translate>Acquisition method</div>
<div class="col-9">{{ holding.metadata.acquisition_method }}</div>
<div class="col-9">{{ holding.metadata.acquisition_method | getTranslatedLabel : language }}</div>
</ng-container>

<!-- ACQUISITION EXPECTED END DATE -->
Expand All @@ -69,18 +69,18 @@
<!-- GENERAL RETENTION POLICY -->
<ng-container *ngIf="context === 'holdings' && holding.metadata.general_retention_policy">
<div class="col-3 font-weight-bold" translate>General retention policy</div>
<div class="col-9">{{ holding.metadata.general_retention_policy }}</div>
<div class="col-9">{{ holding.metadata.general_retention_policy | getTranslatedLabel : language }}</div>
</ng-container>

<!-- COMPLETNESS -->
<ng-container *ngIf="context === 'holdings' && holding.metadata.completeness">
<div class="col-3 font-weight-bold" translate>Completness</div>
<div class="col-9">{{ holding.metadata.completeness }}</div>
<div class="col-9">{{ holding.metadata.completeness | getTranslatedLabel : language }}</div>
</ng-container>

<!-- COMPOSITE COPY REPORT -->
<ng-container *ngIf="context === 'holdings' && holding.metadata.composite_copy_report">
<div class="col-3 font-weight-bold" translate>Composite copy report</div>
<div class="col-9">{{ holding.metadata.composite_copy_report }}</div>
<div class="col-9">{{ holding.metadata.composite_copy_report | getTranslatedLabel : language }}</div>
</ng-container>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import { Component, Input } from '@angular/core';
import { HoldingsNoteType } from '@rero/shared';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'admin-holding-detail',
Expand All @@ -30,11 +31,25 @@ export class HoldingDetailComponent {
/** Context */
@Input() context: 'document'|'holdings' = 'document';


/** Get authorized types of note to be displayed */
get noteAuthorizedTypes(): HoldingsNoteType[] {
return (this.context === 'document')
? [HoldingsNoteType.GENERAL, HoldingsNoteType.ACCESS]
: Object.values(HoldingsNoteType);
}

// GETTER & SETTER ==========================================================
/** Current interface language */
get language() {
return this._translateService.currentLang;
}

// CONSTRUCTOR & HOOKS ==============================================================
/**
* Constructor
* @param _translateService - TranslateService
*/
constructor(
protected _translateService: TranslateService
) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ng-container>
<ng-container *ngVar="itemRequestCounter as pendingRequest">
<span class="pl-3" *ngIf="pendingRequest > 0">
({{ pendingRequest }} {{ pendingRequest | i18nPlural: {'=1': 'request', 'other': 'requests'} }})
({{ pendingRequest }} {{ pendingRequest | i18nPlural: {'=1': 'request', 'other': 'requests'} | translate }})
</span>
</ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
<ng-template #barcodeOnly>{{ item.metadata.barcode }}</ng-template>
</div>
<div class="col-sm-2" name="status">
<i class="fa fa-circle pr-1" [ngClass]="{
<i class="fa fa-circle pr-1" [ngClass]="{
'text-success': item.metadata.available,
'text-danger': !item.metadata.available
}"></i>
{{ item.metadata.status | translate }}
<ng-container *ngVar="itemRequestCounter as pendingRequest">
<div class="pl-3" *ngIf="pendingRequest > 0">
({{ pendingRequest }} {{ pendingRequest | i18nPlural: {'=1': 'request', 'other': 'requests'} }})
</div>
<span class="pl-3" *ngIf="pendingRequest > 0">
({{ pendingRequest }} {{ pendingRequest | i18nPlural: {'=1': 'request', 'other': 'requests'} | translate }})
</span>
</ng-container>
</div>
<div class="col-sm-3" name="issue">{{ item.metadata.enumerationAndChronology }}</div>
Expand Down

0 comments on commit 3af6d42

Please sign in to comment.