mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +00:00
fixed translation service issues
This commit is contained in:
@@ -1629,6 +1629,10 @@
|
|||||||
|
|
||||||
"search.filters.entityType.JournalIssue": "Journal Issue",
|
"search.filters.entityType.JournalIssue": "Journal Issue",
|
||||||
|
|
||||||
|
"search.filters.entityType.JournalVolume": "Journal Volume",
|
||||||
|
|
||||||
|
"search.filters.entityType.OrgUnit": "Organizational Unit",
|
||||||
|
|
||||||
"search.filters.has_content_in_original_bundle.true": "Yes",
|
"search.filters.has_content_in_original_bundle.true": "Yes",
|
||||||
|
|
||||||
"search.filters.has_content_in_original_bundle.false": "No",
|
"search.filters.has_content_in_original_bundle.false": "No",
|
||||||
|
@@ -14,6 +14,7 @@ import { SearchPageComponent } from './search-page.component';
|
|||||||
import { SidebarFilterService } from '../shared/sidebar/filter/sidebar-filter.service';
|
import { SidebarFilterService } from '../shared/sidebar/filter/sidebar-filter.service';
|
||||||
import { SearchFilterService } from '../core/shared/search/search-filter.service';
|
import { SearchFilterService } from '../core/shared/search/search-filter.service';
|
||||||
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
const components = [
|
const components = [
|
||||||
SearchPageComponent,
|
SearchPageComponent,
|
||||||
@@ -28,7 +29,7 @@ const components = [
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
StatisticsModule.forRoot(),
|
StatisticsModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: components,
|
declarations: components,
|
||||||
providers: [
|
providers: [
|
||||||
|
@@ -8,7 +8,7 @@ import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router
|
|||||||
import { MetaReducer, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
import { MetaReducer, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
||||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||||
import { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core';
|
import { DYNAMIC_MATCHER_PROVIDERS } from '@ng-dynamic-forms/core';
|
||||||
import { MissingTranslationHandler, TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
|
||||||
|
|
||||||
import { ENV_CONFIG, GLOBAL_CONFIG, GlobalConfig } from '../config';
|
import { ENV_CONFIG, GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||||
@@ -39,7 +39,6 @@ import { NotificationComponent } from './shared/notifications/notification/notif
|
|||||||
import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component';
|
import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component';
|
||||||
import { SharedModule } from './shared/shared.module';
|
import { SharedModule } from './shared/shared.module';
|
||||||
import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
|
import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
|
||||||
import { MissingTranslationHelper } from './shared/translate/missing-translation.helper';
|
|
||||||
|
|
||||||
export function getConfig() {
|
export function getConfig() {
|
||||||
return ENV_CONFIG;
|
return ENV_CONFIG;
|
||||||
@@ -62,6 +61,7 @@ const IMPORTS = [
|
|||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
ScrollToModule.forRoot(),
|
ScrollToModule.forRoot(),
|
||||||
NgbModule,
|
NgbModule,
|
||||||
|
TranslateModule.forRoot(),
|
||||||
EffectsModule.forRoot(appEffects),
|
EffectsModule.forRoot(appEffects),
|
||||||
StoreModule.forRoot(appReducers),
|
StoreModule.forRoot(appReducers),
|
||||||
StoreRouterConnectingModule.forRoot(),
|
StoreRouterConnectingModule.forRoot(),
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<a class="badge badge-primary mr-1 mb-1 text-capitalize"
|
<a class="badge badge-primary mr-1 mb-1 text-capitalize"
|
||||||
[routerLink]="searchLink"
|
[routerLink]="searchLink"
|
||||||
[queryParams]="(removeParameters | async)" queryParamsHandling="merge">
|
[queryParams]="(removeParameters | async)" queryParamsHandling="merge">
|
||||||
{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + key + '.' + value | translate: {default: normalizeFilterValue(value)} }}
|
{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + filterName + '.' + value | translate: {default: normalizeFilterValue(value)} }}
|
||||||
<span> ×</span>
|
<span> ×</span>
|
||||||
</a>
|
</a>
|
||||||
|
@@ -22,6 +22,11 @@ export class SearchLabelComponent implements OnInit {
|
|||||||
searchLink: string;
|
searchLink: string;
|
||||||
removeParameters: Observable<Params>;
|
removeParameters: Observable<Params>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the filter without the f. prefix
|
||||||
|
*/
|
||||||
|
filterName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the instance variable
|
* Initialize the instance variable
|
||||||
*/
|
*/
|
||||||
@@ -33,6 +38,7 @@ export class SearchLabelComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.searchLink = this.getSearchLink();
|
this.searchLink = this.getSearchLink();
|
||||||
this.removeParameters = this.getRemoveParams();
|
this.removeParameters = this.getRemoveParams();
|
||||||
|
this.filterName = this.getFilterName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,4 +80,8 @@ export class SearchLabelComponent implements OnInit {
|
|||||||
const pattern = /,authority*$/g;
|
const pattern = /,authority*$/g;
|
||||||
return value.replace(pattern, '');
|
return value.replace(pattern, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getFilterName(): string {
|
||||||
|
return this.key.startsWith('f.') ? this.key.substring(2) : this.key;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -206,11 +206,11 @@ const MODULES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const ROOT_MODULES = [
|
const ROOT_MODULES = [
|
||||||
TooltipModule.forRoot(),
|
TranslateModule.forChild({
|
||||||
TranslateModule.forRoot({
|
|
||||||
missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper },
|
missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper },
|
||||||
useDefaultLang: true
|
useDefaultLang: true
|
||||||
})
|
}),
|
||||||
|
TooltipModule.forRoot(),
|
||||||
];
|
];
|
||||||
|
|
||||||
const PIPES = [
|
const PIPES = [
|
||||||
@@ -349,7 +349,9 @@ const COMPONENTS = [
|
|||||||
ExistingMetadataListElementComponent,
|
ExistingMetadataListElementComponent,
|
||||||
ItemAdminSearchResultListElementComponent,
|
ItemAdminSearchResultListElementComponent,
|
||||||
CommunityAdminSearchResultListElementComponent,
|
CommunityAdminSearchResultListElementComponent,
|
||||||
CollectionAdminSearchResultListElementComponent
|
CollectionAdminSearchResultListElementComponent,
|
||||||
|
PublicationSearchResultListElementComponent,
|
||||||
|
ExistingMetadataListElementComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
const ENTRY_COMPONENTS = [
|
const ENTRY_COMPONENTS = [
|
||||||
@@ -415,7 +417,7 @@ const ENTRY_COMPONENTS = [
|
|||||||
ExternalSourceEntryImportModalComponent,
|
ExternalSourceEntryImportModalComponent,
|
||||||
ItemAdminSearchResultListElementComponent,
|
ItemAdminSearchResultListElementComponent,
|
||||||
CommunityAdminSearchResultListElementComponent,
|
CommunityAdminSearchResultListElementComponent,
|
||||||
CollectionAdminSearchResultListElementComponent
|
CollectionAdminSearchResultListElementComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const SHARED_ITEM_PAGE_COMPONENTS = [
|
const SHARED_ITEM_PAGE_COMPONENTS = [
|
||||||
@@ -448,8 +450,8 @@ const DIRECTIVES = [
|
|||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
...ROOT_MODULES,
|
||||||
...MODULES,
|
...MODULES,
|
||||||
...ROOT_MODULES
|
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...PIPES,
|
...PIPES,
|
||||||
@@ -457,8 +459,7 @@ const DIRECTIVES = [
|
|||||||
...DIRECTIVES,
|
...DIRECTIVES,
|
||||||
...ENTRY_COMPONENTS,
|
...ENTRY_COMPONENTS,
|
||||||
...SHARED_ITEM_PAGE_COMPONENTS,
|
...SHARED_ITEM_PAGE_COMPONENTS,
|
||||||
PublicationSearchResultListElementComponent,
|
|
||||||
ExistingMetadataListElementComponent
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...PROVIDERS
|
...PROVIDERS
|
||||||
|
@@ -2,7 +2,6 @@ import {MissingTranslationHandler, MissingTranslationHandlerParams} from '@ngx-t
|
|||||||
|
|
||||||
export class MissingTranslationHelper implements MissingTranslationHandler {
|
export class MissingTranslationHelper implements MissingTranslationHandler {
|
||||||
handle(params: MissingTranslationHandlerParams) {
|
handle(params: MissingTranslationHandlerParams) {
|
||||||
console.log('bla', params);
|
|
||||||
if (params.interpolateParams) {
|
if (params.interpolateParams) {
|
||||||
return (params.interpolateParams as any).default || params.key;
|
return (params.interpolateParams as any).default || params.key;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user