diff options
author | 2018-01-11 10:57:14 +0800 | |
---|---|---|
committer | 2018-01-11 10:57:14 +0800 | |
commit | c825e1c7a6fa1aa8f1c430384620ffd0addf25f8 (patch) | |
tree | 8ac8c13f7062d1907c7f82ca364a8a0d027f6efb /sdc-workflow-designer-ui/src/app/app.module.ts | |
parent | 008518dc35ded3bb6dc3e6352472b5816271f583 (diff) |
add internationalization
add i18n for internationalization
Issue-ID: SDC-901
Change-Id: I2784194b0fbf1f1b3de9dd03feb33d03ba495e15
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/app.module.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/app.module.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sdc-workflow-designer-ui/src/app/app.module.ts b/sdc-workflow-designer-ui/src/app/app.module.ts index 9785a69e..a23b79f7 100644 --- a/sdc-workflow-designer-ui/src/app/app.module.ts +++ b/sdc-workflow-designer-ui/src/app/app.module.ts @@ -14,6 +14,9 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { NgxTreeSelectModule } from 'ngx-tree-select'; +import { HttpClientModule, HttpClient } from '@angular/common/http'; +import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { AccordionModule } from 'ngx-bootstrap/accordion'; @@ -53,6 +56,12 @@ import { ResizableDirective } from './directive/resizable/resizable.directive'; import { StartEventComponent } from './components/property/start-event/start-event.component'; import { NodeParametersComponent } from './components/node-parameters/node-parameters.component'; import { ParameterTreeComponent } from './components/node-parameters/parameter-tree/parameter-tree.component'; +import { NoticeService } from './services/notice.service'; + +// AoT requires an exported function for factories +export function HttpLoaderFactory(http: HttpClient) { + return new TranslateHttpLoader(http, './assets/i18n/', '.json'); +} @NgModule({ declarations: [ @@ -84,6 +93,7 @@ import { ParameterTreeComponent } from './components/node-parameters/parameter-t HttpService, JsPlumbService, ModelService, + NoticeService, RestService, SwaggerTreeConverterService, WorkflowConfigService, @@ -107,6 +117,14 @@ import { ParameterTreeComponent } from './components/node-parameters/parameter-t textField: 'name', childrenField: 'children', allowParentSelection: false + }), + HttpClientModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } }) ], bootstrap: [ |