Skip to content

Commit

Permalink
menu: translate menu entries
Browse files Browse the repository at this point in the history
* Adds missing strings to manual translations.
* Removes some strings from manual translations because they are already
extracted somewhere else in the application.
* Harmonize the translation of the labels in 'resource'-route files.
* Closes rero/rero-ils#1627.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Feb 3, 2021
1 parent 6fef162 commit c4f12e9
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 29 deletions.
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/acquisition-accounts-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { EditorComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { BaseRoute } from './base-route';
Expand All @@ -38,7 +39,7 @@ export class AcquisitionAccountsRoute extends BaseRoute implements RouteInterfac
types: [
{
key: this.name,
label: 'Acquisition accounts',
label: _('Acquisition accounts'),
preCreateRecord: (data: any) => {
const user = this._routeToolService.userService.user;
data.organisation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { DetailComponent, EditorComponent, RecordService, RouteInterface } from '@rero/ng-core';
import { Record, JSONSchema7 } from '@rero/ng-core';
import { DetailComponent, EditorComponent, JSONSchema7, Record, RecordService, RouteInterface } from '@rero/ng-core';
import { map } from 'rxjs/operators';
import { AcqOrderLineGuard } from '../guard/acq-order-line.guard';
import { CanUpdateGuard } from '../guard/can-update.guard';
Expand Down Expand Up @@ -49,7 +49,7 @@ export class AcquisitionOrderLinesRoute extends BaseRoute implements RouteInterf
types: [
{
key: this.name,
label: 'Order lines',
label: _('Order lines'),
detailComponent: AcquisitionOrderLineDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
permissions: (record: any) => this._routeToolService.permissions(record, this.recordType),
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/acquisition-orders-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { formatDate } from '@angular/common';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { AcquisitionOrderBriefViewComponent } from '../record/brief-view/acquisition-order-brief-view.component';
Expand Down Expand Up @@ -48,7 +49,7 @@ export class AcquisitionOrdersRoute extends BaseRoute implements RouteInterface
types: [
{
key: this.name,
label: 'Orders',
label: _('Orders'),
component: AcquisitionOrderBriefViewComponent,
detailComponent: AcquisitionOrderDetailViewComponent,
permissions: (record: any) => this._routeToolService.permissions(record, this.recordType),
Expand Down
4 changes: 3 additions & 1 deletion projects/admin/src/app/routes/budgets-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { RoleGuard } from '../guard/role.guard';
import { BudgetsBriefViewComponent } from '../record/brief-view/budgets-brief-view.component';
import { BudgetDetailViewComponent } from '../record/detail-view/budget-detail-view/budget-detail-view.component';
import { BaseRoute } from './base-route';


export class BudgetsRoute extends BaseRoute implements RouteInterface {

/** Route name */
Expand All @@ -46,7 +48,7 @@ export class BudgetsRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Budgets',
label: _('Budgets'),
component: BudgetsBriefViewComponent,
detailComponent: BudgetDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
Expand Down
4 changes: 3 additions & 1 deletion projects/admin/src/app/routes/circulation-policies-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { RoleGuard } from '../guard/role.guard';
Expand All @@ -22,6 +23,7 @@ import { CirculationPolicyComponent } from '../record/custom-editor/circulation-
import { CircPolicyDetailViewComponent } from '../record/detail-view/circ-policy-detail-view/circ-policy-detail-view.component';
import { BaseRoute } from './base-route';


export class CirculationPoliciesRoute extends BaseRoute implements RouteInterface {

/** Route name */
Expand All @@ -47,7 +49,7 @@ export class CirculationPoliciesRoute extends BaseRoute implements RouteInterfac
types: [
{
key: this.name,
label: 'Circulation policies',
label: _('Circulation policies'),
component: CircPoliciesBriefViewComponent,
detailComponent: CircPolicyDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
Expand Down
4 changes: 3 additions & 1 deletion projects/admin/src/app/routes/item-types-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { RoleGuard } from '../guard/role.guard';
import { ItemTypesBriefViewComponent } from '../record/brief-view/item-types-brief-view.component';
import { ItemTypeDetailViewComponent } from '../record/detail-view/item-type-detail-view.component';
import { BaseRoute } from './base-route';


export class ItemTypesRoute extends BaseRoute implements RouteInterface {

/** Route name */
Expand All @@ -46,7 +48,7 @@ export class ItemTypesRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Item types',
label: _('Item types'),
component: ItemTypesBriefViewComponent,
detailComponent: ItemTypeDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/locations-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { LibraryGuard } from '../guard/library.guard';
Expand Down Expand Up @@ -44,7 +45,7 @@ export class LocationsRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Locations',
label: _('Locations'),
detailComponent: LocationDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
permissions: (record: any) => this._routeToolService.permissions(record, this.recordType),
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/organisations-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RouteInterface } from '@rero/ng-core';
import { of } from 'rxjs';
import { CanUpdateGuard } from '../guard/can-update.guard';
Expand Down Expand Up @@ -44,7 +45,7 @@ export class OrganisationsRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Organisations',
label: _('Organisations'),
detailComponent: OrganisationDetailViewComponent
}
]
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/patron-types-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { RoleGuard } from '../guard/role.guard';
Expand Down Expand Up @@ -47,7 +48,7 @@ export class PatronTypesRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Patron types',
label: _('Patron types'),
component: PatronTypesBriefViewComponent,
detailComponent: PatronTypesDetailViewComponent,
canAdd: () => this._routeToolService.canSystemLibrarian(),
Expand Down
4 changes: 3 additions & 1 deletion projects/admin/src/app/routes/patrons-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { FormlyFieldConfig } from '@ngx-formly/core';
import {
DetailComponent, EditorComponent, extractIdOnRef, JSONSchema7, Record, RecordSearchPageComponent, RecordService, RouteInterface
Expand All @@ -24,6 +25,7 @@ import { PatronsBriefViewComponent } from '../record/brief-view/patrons-brief-vi
import { PatronDetailViewComponent } from '../record/detail-view/patron-detail-view/patron-detail-view.component';
import { BaseRoute } from './base-route';


export class PatronsRoute extends BaseRoute implements RouteInterface {

/** Route name */
Expand All @@ -49,7 +51,7 @@ export class PatronsRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Users',
label: _('Users'),
editorSettings: {
template: {
recordType: 'templates',
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/persons-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { of } from 'rxjs';
import { ContributionBriefComponent } from '@rero/shared';
import { ContributionDetailViewComponent } from '../record/detail-view/contribution-detail-view/contribution-detail-view.component';
import { BaseRoute } from './base-route';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';

export class PersonsRoute extends BaseRoute implements RouteInterface {

Expand All @@ -45,7 +46,7 @@ export class PersonsRoute extends BaseRoute implements RouteInterface {
{
key: 'persons',
index: 'contributions',
label: 'Persons',
label: _('Persons'),
component: ContributionBriefComponent,
detailComponent: ContributionDetailViewComponent,
aggregationsOrder: ['sources'],
Expand Down
7 changes: 4 additions & 3 deletions projects/admin/src/app/routes/templates-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { ActionStatus, DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { JSONSchema7 } from '@rero/ng-core';
import { ActionStatus, DetailComponent, EditorComponent, JSONSchema7, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { Observable, Subscriber } from 'rxjs';
import { CanUpdateGuard } from '../guard/can-update.guard';
import { TemplatesBriefViewComponent } from '../record/brief-view/templates-brief-view.component';
import { TemplateDetailViewComponent } from '../record/detail-view/template-detail-view/template-detail-view.component';
import { BaseRoute } from './base-route';


export class TemplatesRoute extends BaseRoute implements RouteInterface {

/** Route name */
Expand All @@ -48,7 +49,7 @@ export class TemplatesRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Templates',
label: _('Templates'),
component: TemplatesBriefViewComponent,
detailComponent: TemplateDetailViewComponent,
canAdd: () => this._routeToolService.canNot(),
Expand Down
3 changes: 2 additions & 1 deletion projects/admin/src/app/routes/vendors-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DetailComponent, EditorComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core';
import { VendorBriefViewComponent } from '../record/brief-view/vendor-brief-view.component';
import { VendorDetailViewComponent } from '../record/detail-view/vendor-detail-view/vendor-detail-view.component';
Expand Down Expand Up @@ -44,7 +45,7 @@ export class VendorsRoute extends BaseRoute implements RouteInterface {
types: [
{
key: this.name,
label: 'Vendors',
label: _('Vendors'),
component: VendorBriefViewComponent,
detailComponent: VendorDetailViewComponent,
permissions: (record: any) => this._routeToolService.permissions(record, this.recordType),
Expand Down
26 changes: 14 additions & 12 deletions projects/admin/src/manual_translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,19 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';

// Resources
_('acq_accounts');
_('Acquisition accounts');
_('acq_order_lines');
_('Order lines');
_('acq_orders');
_('Orders');
_('budgets');
_('Budgets');
_('circ_policies');
_('Circulation policies');
_('documents');
_('item_types');
_('Item types');
_('libraries');
_('Libraries');
_('locations');
_('Locations');
_('organisations');
_('Organisations');
_('Patrons');
_('patron_types');
_('Patron types');
_('persons');
_('Persons');
_('vendors');
_('Vendors');

// Facets
_('author');
Expand Down Expand Up @@ -150,3 +138,17 @@ _('{{ counter }} hidden issue');
_('{{ counter }} hidden issues');
_('{{ counter }} hidden item');
_('{{ counter }} hidden items');

// Menu entries
_('User services');
_('ILL requests');
_('Import from the web');
_('Corporate bodies');
_('Late issues');
_('Reports & monitoring');
_('Inventory list');
_('Admin');
_('My organisation');
_('My library');
_('Public interface');
_('Logout');

0 comments on commit c4f12e9

Please sign in to comment.