File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1+ import { NgModule } from "@angular/core" ;
2+ import { TranslateModule , TranslateService } from "@ngx-translate/core" ;
3+ const en = require ( "./../src/i18n/en.json" ) ;
4+
5+ @NgModule ( {
6+ imports : [
7+ TranslateModule . forRoot ( )
8+ ]
9+ } )
10+ export class BootstrapModule {
11+ constructor ( private translateService : TranslateService ) {
12+ this . translateService . setDefaultLang ( "en" ) ;
13+ this . translateService . use ( "en" ) ;
14+ this . translateService . setTranslation ( "en" , en ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change @@ -3,16 +3,17 @@ import { withNotes } from "@storybook/addon-notes";
33import { action } from "@storybook/addon-actions" ;
44import { withKnobs , boolean , object } from "@storybook/addon-knobs/angular" ;
55
6- import { TranslateModule } from "@ngx-translate/core" ;
7-
86import { DropdownModule } from "../" ;
97
8+ // needed to init ngx translate and load the translations
9+ import { BootstrapModule } from "../../.storybook/bootstrap.module" ;
10+
1011storiesOf ( "Dropdown" , module )
1112 . addDecorator (
1213 moduleMetadata ( {
1314 imports : [
1415 DropdownModule ,
15- TranslateModule . forRoot ( )
16+ BootstrapModule
1617 ] ,
1718 } )
1819 )
You can’t perform that action at this time.
0 commit comments