diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 1bdcb0cf5f..ea7ad35325 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -302,6 +302,12 @@ }, "listelement": { "badge": "Person" + }, + "search": { + "title": "DSpace Angular :: Person Search", + "results": { + "head": "Person Search Results" + } } }, "project": { @@ -342,6 +348,12 @@ }, "listelement": { "badge": "Journal" + }, + "search": { + "title": "DSpace Angular :: Journal Search", + "results": { + "head": "Journal Search Results" + } } }, "journalvolume": { @@ -378,6 +390,12 @@ }, "listelement": { "badge": "Publication" + }, + "search": { + "title": "DSpace Angular :: Publication Search", + "results": { + "head": "Publication Search Results" + } } }, "nav": { @@ -429,24 +447,6 @@ } }, "search": { - "journal": { - "title": "DSpace Angular :: Journal Search", - "results": { - "head": "Journal Search Results" - } - }, - "person": { - "title": "DSpace Angular :: Person Search", - "results": { - "head": "Person Search Results" - } - }, - "publication": { - "title": "DSpace Angular :: Publication Search", - "results": { - "head": "Publication Search Results" - } - }, "title": "DSpace Angular :: Search", "description": "", "form": { diff --git a/src/app/+search-page/filtered-search-page.guard.ts b/src/app/+search-page/filtered-search-page.guard.ts index 39fbb48c67..6d41d4965d 100644 --- a/src/app/+search-page/filtered-search-page.guard.ts +++ b/src/app/+search-page/filtered-search-page.guard.ts @@ -4,10 +4,8 @@ import { Observable } from 'rxjs'; @Injectable() /** - * Assemble the correct i18n key for the filtered search page's title depending on the current route's filter parameter - * and title data. - * The format of the key will be "{title}{filter}.title" with: - * - title: The prefix of the key stored in route.data + * Assemble the correct i18n key for the filtered search page's title depending on the current route's filter parameter. + * The format of the key will be "{filter}.search.title" with: * - filter: The current filter stored in route.params */ export class FilteredSearchPageGuard implements CanActivate { @@ -16,7 +14,7 @@ export class FilteredSearchPageGuard implements CanActivate { state: RouterStateSnapshot): Observable | Promise | boolean { const filter = route.params.filter; - const newTitle = route.data.title + filter + '.title'; + const newTitle = filter + '.search.title'; route.data = { title: newTitle }; return true; diff --git a/src/app/+search-page/search-page-routing.module.ts b/src/app/+search-page/search-page-routing.module.ts index 8c138c0d52..c3cf4e1343 100644 --- a/src/app/+search-page/search-page-routing.module.ts +++ b/src/app/+search-page/search-page-routing.module.ts @@ -9,7 +9,7 @@ import { FilteredSearchPageGuard } from './filtered-search-page.guard'; imports: [ RouterModule.forChild([ { path: '', component: SearchPageComponent, data: { title: 'search.title' } }, - { path: ':filter', component: FilteredSearchPageComponent, canActivate: [FilteredSearchPageGuard], data: { title: 'search.' }} + { path: ':filter', component: FilteredSearchPageComponent, canActivate: [FilteredSearchPageGuard]} ]) ] }) diff --git a/src/app/+search-page/search-results/search-results.component.ts b/src/app/+search-page/search-results/search-results.component.ts index 9656ba9574..c2c86e8a9f 100644 --- a/src/app/+search-page/search-results/search-results.component.ts +++ b/src/app/+search-page/search-results/search-results.component.ts @@ -60,7 +60,7 @@ export class SearchResultsComponent { */ getTitleKey() { if (isNotEmpty(this.fixedFilter)) { - return 'search.' + this.fixedFilter + '.results.head' + return this.fixedFilter + '.search.results.head' } else { return 'search.results.head'; }