Skip to content

Commit

Permalink
fix: search components translations
Browse files Browse the repository at this point in the history
* Use only extractor instead of instant translate for labels in the
route. As they have no knowledge of langugage, they are translated by
ng-core.

Co-Authored-by: Pascal Repond <[email protected]>
  • Loading branch information
PascalRepond committed Jan 9, 2024
1 parent 2eabdea commit 44f9bf9
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions projects/sonar/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { map, switchMap } from 'rxjs/operators';
import { DashboardComponent } from './dashboard/dashboard.component';
import { BriefViewComponent } from './deposit/brief-view/brief-view.component';
import { ConfirmationComponent } from './deposit/confirmation/confirmation.component';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { EditorComponent as DepositEditorComponent } from './deposit/editor/editor.component';
import { UploadComponent } from './deposit/upload/upload.component';
import { CanAddGuard } from './guard/can-add.guard';
Expand Down Expand Up @@ -131,34 +132,34 @@ export class AppRoutingModule {
aggregationsBucketSize: 10,
searchFields: [
{
label: this._translateService.instant('full-text'),
label: _('full-text'),
path: 'fulltext'
}
],
searchFilters: [
{
label: this._translateService.instant('Open access'),
label: _('Open access'),
filter: 'open_access',
value: 'true'
}
],
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true
},
{
label: this._translateService.instant('Date descending'),
label: _('Date descending'),
value: 'newest',
defaultNoQuery: true
},
{
label: this._translateService.instant('Date ascending'),
label: _('Date ascending'),
value: 'oldest',
},
{
label: this._translateService.instant('Title'),
label: _('Title'),
value: 'title'
}
]
Expand Down Expand Up @@ -267,27 +268,27 @@ export class AppRoutingModule {
},
searchFields: [
{
label: this._translateService.instant('full-text'),
label: _('full-text'),
path: 'fulltext',
},
],
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Date descending'),
label: _('Date descending'),
value: 'newest',
defaultNoQuery: true,
},
{
label: this._translateService.instant('Date ascending'),
label: _('Date ascending'),
value: 'oldest',
},
{
label: this._translateService.instant('Title'),
label: _('Title'),
value: 'title',
},
],
Expand All @@ -302,12 +303,12 @@ export class AppRoutingModule {
},
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Name'),
label: _('Name'),
value: 'name',
defaultNoQuery: true,
},
Expand All @@ -322,12 +323,12 @@ export class AppRoutingModule {
},
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Name'),
label: _('Name'),
value: 'name',
defaultNoQuery: true,
},
Expand All @@ -341,17 +342,17 @@ export class AppRoutingModule {
aggregationsOrder: ['status', 'user', 'contributor', 'subdivision'],
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Date descending'),
label: _('Date descending'),
value: 'newest',
defaultNoQuery: true,
},
{
label: this._translateService.instant('Date ascending'),
label: _('Date ascending'),
value: 'oldest',
},
],
Expand All @@ -375,21 +376,21 @@ export class AppRoutingModule {
],
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Name'),
label: _('Name'),
value: 'name',
defaultNoQuery: true,
},
{
label: this._translateService.instant('Date descending'),
label: _('Date descending'),
value: 'newest',
},
{
label: this._translateService.instant('Date ascending'),
label: _('Date ascending'),
value: 'oldest',
},
],
Expand All @@ -407,12 +408,12 @@ export class AppRoutingModule {
},
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Name'),
label: _('Name'),
value: 'name',
defaultNoQuery: true,
},
Expand All @@ -428,12 +429,12 @@ export class AppRoutingModule {
},
sortOptions: [
{
label: this._translateService.instant('Relevance'),
label: _('Relevance'),
value: 'relevance',
defaultQuery: true,
},
{
label: this._translateService.instant('Name'),
label: _('Name'),
value: 'name',
defaultNoQuery: true,
},
Expand Down

0 comments on commit 44f9bf9

Please sign in to comment.