Skip to content

Commit

Permalink
SHIBUI-701 Translate error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 12, 2018
1 parent f1b970b commit 2909106
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ui/src/app/metadata/provider/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { MetadataProvider } from '../../domain/model';
import { AddNotification } from '../../../notification/action/notification.action';
import { Notification, NotificationType } from '../../../notification/model/notification';
import { WizardActionTypes, SetDisabled } from '../../../wizard/action/wizard.action';
import { I18nService } from '../../../i18n/service/i18n.service';
import * as fromI18n from '../../../i18n/reducer';


/* istanbul ignore next */
Expand Down Expand Up @@ -108,10 +110,11 @@ export class CollectionEffects {
createProviderFailDispatchNotification$ = this.actions$.pipe(
ofType<AddProviderFail>(ProviderCollectionActionTypes.ADD_PROVIDER_FAIL),
map(action => action.payload),
map(error => new AddNotification(
withLatestFrom(this.store.select(fromI18n.getMessages)),
map(([error, messages]) => new AddNotification(
new Notification(
NotificationType.Danger,
`${error.errorCode}: ${ error.errorMessage }`,
`${error.errorCode}: ${ this.i18nService.translate(error.errorMessage, null, messages) }`,
8000
)
))
Expand Down Expand Up @@ -242,6 +245,7 @@ export class CollectionEffects {
private router: Router,
private store: Store<fromRoot.State>,
private providerService: MetadataProviderService,
private contentionService: ContentionService
private contentionService: ContentionService,
private i18nService: I18nService
) { }
}

0 comments on commit 2909106

Please sign in to comment.