From 79105d462f6d9732dab0b13fb88cd1d244fad88c Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 12 Oct 2018 22:05:36 +0900 Subject: [PATCH] ing --- angular.json | 3 +- src/app/app.component.ts | 13 ++++- src/app/app.module.ts | 3 +- .../infra/detail/host.component.html | 28 ++++----- .../infra/display/map.component.html | 8 +-- .../scanner-setting-dropdown.component.html | 12 ++-- src/app/pages/home/home-page.component.html | 4 +- src/app/service/electron-proxy.service.ts | 6 +- src/app/service/i18n.service.ts | 8 +-- src/assets/i18n/en.json | 19 +++++-- src/assets/i18n/ko.json | 57 ++++++++++++++++++- src/electron/main.ts | 2 +- src/electron/menu/build-default.ts | 2 - 13 files changed, 118 insertions(+), 47 deletions(-) diff --git a/angular.json b/angular.json index a81fa20..71b8d5a 100644 --- a/angular.json +++ b/angular.json @@ -27,7 +27,8 @@ "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.ico", - "src/assets/image" + "src/assets/image", + "src/assets/i18n" ], "styles": [ "node_modules/primeicons/primeicons.css", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2582662..9770549 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,6 +5,8 @@ import { Store, select } from '@ngrx/store'; import { of, Subscription } from 'rxjs'; import { map, catchError, take } from 'rxjs/operators'; +import { TranslateService } from '@ngx-translate/core'; + import { ElectronProxyService } from './service/electron-proxy.service'; import { MenuEvent } from '../commons/type'; import * as AppStore from './store/app'; @@ -31,11 +33,14 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On public constructor( private changeDetector: ChangeDetectorRef, private store: Store, + private translateService: TranslateService, private electronProxyService: ElectronProxyService, ) { // this.showTitleBar = !__LINUX__; this.showTitleBar = false; this.block = false; + this.translateService.setDefaultLang('en'); + this.translateService.use('en'); } ngOnInit(): void { @@ -65,13 +70,19 @@ export class AppComponent implements OnInit, AfterContentInit, AfterViewInit, On case 'show-print': this.displayPrint = true; break; + case 'change-language-english': + this.translateService.use('en'); + break; + case 'change-language-korean': + this.translateService.use('ko'); + break; default: break; } this.changeDetector.detectChanges(); }), catchError(error => { - return of(); + return of(error); }), ) .subscribe(); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 03ad874..42893f3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -36,7 +36,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { loader: { provide: TranslateLoader, useExisting: I18nService, - } + }, + useDefaultLang: true, }), PerfectScrollbarModule, diff --git a/src/app/component/infra/detail/host.component.html b/src/app/component/infra/detail/host.component.html index 1d0d638..7e002cf 100644 --- a/src/app/component/infra/detail/host.component.html +++ b/src/app/component/infra/detail/host.component.html @@ -19,37 +19,37 @@ - +
  • - IP Address + {{ 'infra.detail.general.ip_address' | translate }} {{host.address}}
  • - Type + {{ 'infra.detail.general.type' | translate }} {{host.hostType}}
  • - Vendor + {{ 'infra.detail.general.vendor' | translate }} {{host.hostVendor}}
  • - Model + {{ 'infra.detail.general.model' | translate }} {{host.hostModel}}
  • - OS + {{ 'infra.detail.general.os' | translate }} {{host.osType}}
  • - Mac Address + {{ 'infra.detail.general.mac_address' | translate }} {{host.mac}}
@@ -57,7 +57,7 @@
- +
- +
    @@ -88,24 +88,24 @@
- +
-
Count
+
{{ 'infra.detail.health.count' | translate }}
-
Interval
+
{{ 'infra.detail.health.interval' | translate }}
-
Deadline
+
{{ 'infra.detail.health.deadline' | translate }}
- +
diff --git a/src/app/component/infra/display/map.component.html b/src/app/component/infra/display/map.component.html index d18c72f..51c9a31 100644 --- a/src/app/component/infra/display/map.component.html +++ b/src/app/component/infra/display/map.component.html @@ -53,16 +53,16 @@
-
Total Hosts:
{{displaySummary.totalHosts}} +
{{ 'discovery.summary.total_hosts' | translate }}:
{{displaySummary.totalHosts}}
-
Total Ports:
{{displaySummary.totalPorts}} +
{{ 'discovery.summary.total_ports' | translate }}:
{{displaySummary.totalPorts}}
-
Total Services:
{{displaySummary.totalServices}} +
{{ 'discovery.summary.total_services' | translate }}:
{{displaySummary.totalServices}}
-
Elapsed:
{{displaySummary.elapsedTime}} +
{{ 'discovery.summary.elapsed' | translate }}:
{{displaySummary.elapsedTime}}
\ No newline at end of file diff --git a/src/app/component/layout/toolbar/scanner-setting-dropdown.component.html b/src/app/component/layout/toolbar/scanner-setting-dropdown.component.html index 3e3cbbc..c9f48d5 100644 --- a/src/app/component/layout/toolbar/scanner-setting-dropdown.component.html +++ b/src/app/component/layout/toolbar/scanner-setting-dropdown.component.html @@ -29,7 +29,7 @@
-

IP

+

{{ 'network.ip' | translate }}

@@ -37,7 +37,7 @@
-
Range : +
{{ 'network.range' | translate }} : -
-

Port

+

{{ 'network.port' | translate }}

@@ -60,7 +60,7 @@
-
Range : +
{{ 'network.range' | translate }} : - -->
- - + +