Skip to content

Commit

Permalink
translations: fix string translation i18n pipe
Browse files Browse the repository at this point in the history
* Closes rero/rero-ils#3112

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Mar 20, 2023
1 parent 35b5248 commit 7bb6c8c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
RERO ILS UI
Copyright (C) 2019-2022 RERO
Copyright (C) 2019-2022 UCLouvain
Copyright (C) 2019-2023 RERO
Copyright (C) 2019-2023 UCLouvain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -60,7 +60,7 @@ <h5 class="m-0">
(click)="notesCollapsed = !notesCollapsed"
[attr.aria-expanded]="!notesCollapsed" aria-controls="collapse">
</button>
{{ order.notes.length | i18nPlural: {'=1': 'Note', 'other': 'Notes'} }}
{{ order.notes.length | i18nPlural: {'=1': 'Note', 'other': 'Notes'} | translate }}
<span *ngIf="notesCollapsed" class="badge badge-secondary ml-2">{{ order.notes.length }}</span>
</h5>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
RERO ILS UI
Copyright (C) 2021 RERO
Copyright (C) 2021 UCLouvain
Copyright (C) 2021-2023 RERO
Copyright (C) 2021-2023 UCLouvain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand All @@ -18,7 +18,7 @@
<div class="card mb-3 container">
<div class="card-header px-0 row">
<h5 class="col-8 m-0">
{{ numberOfReceipt | i18nPlural: {'=1': 'Receipt', 'other': 'Receipts'} }}
{{ numberOfReceipt | i18nPlural: {'=1': 'Receipt', 'other': 'Receipts'} | translate }}
<span class="badge badge-secondary ml-2">{{ numberOfReceipt }}</span>
</h5>
<div class="col-4 text-right">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
RERO ILS UI
Copyright (C) 2021 RERO
Copyright (C) 2021 UCLouvain
Copyright (C) 2021-2023 RERO
Copyright (C) 2021-2023 UCLouvain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -45,8 +45,8 @@
<div class="ml-auto" *ngIf="receipt.quantity">
<div class="badge badge-info small">
<i class="fa fa-sign-in mr-1"></i>
{{ receipt.quantity}}
{{ receipt.quantity | i18nPlural: {'=1': 'item', 'other': 'items'} }}
{{ receipt.quantity }}
{{ receipt.quantity | i18nPlural: {'=1': 'item', 'other': 'items'} | translate }}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
RERO ILS UI
Copyright (C) 2019-2022 RERO
Copyright (C) 2019-2023 RERO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -218,7 +218,7 @@ <h3 id="{{ 'doc-altgr-title-' + i }}">{{ altgr_title }}</h3>
>
<i class="fa fa-list" aria-hidden="true"></i>
{{ linkedDocumentsCount }}
{{ linkedDocumentsCount | i18nPlural: {'=1': 'article/volume', 'other': 'articles/volumes'} }}
{{ linkedDocumentsCount | i18nPlural: {'=1': 'article/volume', 'other': 'articles/volumes'} | translate }}
</a>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
RERO ILS UI
Copyright (C) 2019-2022 RERO
Copyright (C) 2019-2023 RERO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -57,11 +57,11 @@ <h1>
<ng-container *ngVar="phones as patronPhones">
<ng-container *ngIf="patronPhones.length > 0">
<dt class="col-1 text-right"><i class="fa fa-phone"></i></dt>
<dt class="col-3">{{ patronPhones.length | i18nPlural: {'=1': 'Phone', 'other': 'Phones'} }}</dt>
<dt class="col-3" translate>{{ patronPhones.length | i18nPlural: {'=1': 'Phone', 'other': 'Phones'} }}</dt>
<dd class="col-8">
<ul class="list-unstyled m-0">
<li *ngFor="let phone of patronPhones">
<span class="metadata">{{ phone.type }}</span> {{ phone.value }}
<span class="metadata" translate>{{ phone.type }}</span> {{ phone.value }}
</li>
</ul>
</dd>
Expand All @@ -85,7 +85,7 @@ <h1>
(click)="sectionCollapsed.notes = !sectionCollapsed.notes"
[attr.aria-expanded]="!sectionCollapsed.notes" aria-controls="collapse">
</button>
{{ patron.notes.length | i18nPlural: {'=1': 'Note', 'other': 'Notes'} }}
{{ patron.notes.length | i18nPlural: {'=1': 'Note', 'other': 'Notes'} | translate }}
<span *ngIf="sectionCollapsed.notes" class="badge badge-secondary ml-2">{{ patron.notes.length }}</span>
</div>
<div class="card-body py-2" [hidden]="sectionCollapsed.notes">
Expand Down Expand Up @@ -163,9 +163,11 @@ <h1>
<dt class="col-1 text-right"><i class="fa fa-home"></i> </dt>
<dt class="col-3" translate>Second address</dt>
<dd class="col-8">
{{ patron.second_address.street }}<br/>
{{ patron.second_address.postal_code }} {{ patron.second_address.city }}<br/>
{{ 'country_' + patron.second_address.country | translate }}
<ng-container *ngIf="patron.second_address.street">{{ patron.second_address.street }}<br/></ng-container>
<ng-container *ngIf="patron.second_address.postal_code or patron.second_address.city">
{{ patron.second_address.postal_code }} {{ patron.second_address.city }}<br/>
</ng-container>
<ng-container *ngIf="patron.second_address.country">{{ 'country_' + patron.second_address.country | translate }}</ng-container>
</dd>
</ng-container>
</dl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
RERO ILS UI
Copyright (C) 2021 RERO
Copyright (C) 2021-2023 RERO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down
4 changes: 4 additions & 0 deletions projects/public-search/src/manual_translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ _('not available');
_('request');
_('requests');
_('see collections and items');

// Loans
_('renewal');
_('renewals');

0 comments on commit 7bb6c8c

Please sign in to comment.