mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 11:33:04 +00:00
added missing translation helper for facets
This commit is contained in:
@@ -1627,6 +1627,13 @@
|
||||
|
||||
|
||||
|
||||
"search.filters.entityType.JournalIssue": "Journal Issue",
|
||||
|
||||
"search.filters.has_content_in_original_bundle.true": "Yes",
|
||||
|
||||
"search.filters.has_content_in_original_bundle.false": "No",
|
||||
|
||||
|
||||
"search.filters.head": "Filters",
|
||||
|
||||
"search.filters.reset": "Reset filters",
|
||||
@@ -2006,7 +2013,7 @@
|
||||
"title": "DSpace",
|
||||
|
||||
|
||||
"undiscoverable.search.results.head": "Admin Search",
|
||||
"discoverableAndUndiscoverableItems.search.results.head": "Admin Search",
|
||||
|
||||
|
||||
"uploader.browse": "browse",
|
||||
|
@@ -1 +1 @@
|
||||
<ds-configuration-search-page configuration="undiscoverable" [context]="context"></ds-configuration-search-page>
|
||||
<ds-configuration-search-page configuration="discoverableAndUndiscoverableItems" [context]="context"></ds-configuration-search-page>
|
||||
|
@@ -8,7 +8,7 @@ import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router
|
||||
import { MetaReducer, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||
import { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MissingTranslationHandler, TranslateModule } from '@ngx-translate/core';
|
||||
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
||||
|
||||
import { ENV_CONFIG, GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
@@ -39,6 +39,7 @@ import { NotificationComponent } from './shared/notifications/notification/notif
|
||||
import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component';
|
||||
import { SharedModule } from './shared/shared.module';
|
||||
import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
|
||||
import { MissingTranslationHelper } from './shared/translate/missing-translation.helper';
|
||||
|
||||
export function getConfig() {
|
||||
return ENV_CONFIG;
|
||||
@@ -61,7 +62,6 @@ const IMPORTS = [
|
||||
CoreModule.forRoot(),
|
||||
ScrollToModule.forRoot(),
|
||||
NgbModule,
|
||||
TranslateModule.forRoot(),
|
||||
EffectsModule.forRoot(appEffects),
|
||||
StoreModule.forRoot(appReducers),
|
||||
StoreRouterConnectingModule.forRoot(),
|
||||
|
@@ -2,7 +2,9 @@
|
||||
[routerLink]="[searchLink]"
|
||||
[queryParams]="addQueryParams" queryParamsHandling="merge">
|
||||
<input type="checkbox" [checked]="false" class="my-1 align-self-stretch"/>
|
||||
<span class="filter-value px-1">{{filterValue.value}}</span>
|
||||
<span class="filter-value px-1">
|
||||
{{ 'search.filters.' + filterConfig.name + '.' + filterValue.value | translate: {default: filterValue.value} }}
|
||||
</span>
|
||||
<span class="float-right filter-value-count ml-auto">
|
||||
<span class="badge badge-secondary badge-pill">{{filterValue.count}}</span>
|
||||
</span>
|
||||
|
@@ -2,5 +2,7 @@
|
||||
[routerLink]="[searchLink]"
|
||||
[queryParams]="removeQueryParams" queryParamsHandling="merge">
|
||||
<input type="checkbox" [checked]="true" class="my-1 align-self-stretch"/>
|
||||
<span class="filter-value pl-1 text-capitalize">{{selectedValue.label}}</span>
|
||||
<span class="filter-value pl-1 text-capitalize">
|
||||
{{ 'search.filters.' + filterConfig.name + '.' + selectedValue.value | translate: {default: selectedValue.value} }}
|
||||
</span>
|
||||
</a>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<a class="badge badge-primary mr-1 mb-1 text-capitalize"
|
||||
[routerLink]="searchLink"
|
||||
[queryParams]="(removeParameters | async)" queryParamsHandling="merge">
|
||||
{{('search.filters.applied.' + key) | translate}}: {{normalizeFilterValue(value)}}
|
||||
{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + key + '.' + value | translate: {default: normalizeFilterValue(value)} }}
|
||||
<span> ×</span>
|
||||
</a>
|
||||
</a>
|
||||
|
@@ -6,7 +6,7 @@ import { NouisliderModule } from 'ng2-nouislider';
|
||||
|
||||
import { NgbDatepickerModule, NgbModule, NgbTimepickerModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MissingTranslationHandler, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { NgxPaginationModule } from 'ngx-pagination';
|
||||
import { PublicationListElementComponent } from './object-list/item-list-element/item-types/publication/publication-list-element.component';
|
||||
@@ -180,6 +180,7 @@ import { SortablejsModule } from 'ngx-sortablejs';
|
||||
import { ItemAdminSearchResultListElementComponent } from './object-list/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component';
|
||||
import { CommunityAdminSearchResultListElementComponent } from './object-list/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component';
|
||||
import { CollectionAdminSearchResultListElementComponent } from './object-list/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component';
|
||||
import { MissingTranslationHelper } from './translate/missing-translation.helper';
|
||||
|
||||
const MODULES = [
|
||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
||||
@@ -197,7 +198,6 @@ const MODULES = [
|
||||
NgxPaginationModule,
|
||||
ReactiveFormsModule,
|
||||
RouterModule,
|
||||
TranslateModule,
|
||||
NouisliderModule,
|
||||
MomentModule,
|
||||
TextMaskModule,
|
||||
@@ -206,7 +206,11 @@ const MODULES = [
|
||||
];
|
||||
|
||||
const ROOT_MODULES = [
|
||||
TooltipModule.forRoot()
|
||||
TooltipModule.forRoot(),
|
||||
TranslateModule.forRoot({
|
||||
missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper },
|
||||
useDefaultLang: true
|
||||
})
|
||||
];
|
||||
|
||||
const PIPES = [
|
||||
|
11
src/app/shared/translate/missing-translation.helper.ts
Normal file
11
src/app/shared/translate/missing-translation.helper.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import {MissingTranslationHandler, MissingTranslationHandlerParams} from '@ngx-translate/core';
|
||||
|
||||
export class MissingTranslationHelper implements MissingTranslationHandler {
|
||||
handle(params: MissingTranslationHandlerParams) {
|
||||
console.log('bla', params);
|
||||
if (params.interpolateParams) {
|
||||
return (params.interpolateParams as any).default || params.key;
|
||||
}
|
||||
return params.key;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user