|
|
@ -1,6 +1,6 @@ |
|
|
import { Inject, Injectable } from '@angular/core'; |
|
|
import { Inject, Injectable } from '@angular/core'; |
|
|
import { Observable, Subject, of } from 'rxjs'; |
|
|
import { Observable, Subject, of } from 'rxjs'; |
|
|
import { map, switchMap, take } from 'rxjs/operators'; |
|
|
import { map, switchMap, take, tap } from 'rxjs/operators'; |
|
|
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service'; |
|
|
import { AbpApplicationConfigurationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service'; |
|
|
import { AbpApplicationLocalizationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service'; |
|
|
import { AbpApplicationLocalizationService } from '../proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service'; |
|
|
import { |
|
|
import { |
|
|
@ -62,17 +62,15 @@ export class ConfigStateService { |
|
|
return this.createOnUpdateStream(state => state).pipe(take(1)); |
|
|
return this.createOnUpdateStream(state => state).pipe(take(1)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
refreshLocalization(lang:string) { |
|
|
refreshLocalization(lang:string): Observable<null> { |
|
|
if (this.includeLocalizationResources) { |
|
|
if (this.includeLocalizationResources) { |
|
|
return this.refreshAppState(); |
|
|
return this.refreshAppState().pipe(map(()=> null)); |
|
|
} else { |
|
|
} else { |
|
|
return this.getlocalizationResource(lang) |
|
|
return this.getlocalizationResource(lang) |
|
|
.pipe( |
|
|
.pipe( |
|
|
switchMap(result => { |
|
|
tap(result => this.store.patch({ localization: { ...this.store.state.localization, ...result } })) |
|
|
this.store.patch({ localization: { ...this.store.state.localization, ...result } }); |
|
|
) |
|
|
return of(null); |
|
|
.pipe(map(()=> null)); |
|
|
}), |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|