From 26d112bd55816ccd0df6128bc63420af25c2a984 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Wed, 18 Dec 2019 13:44:26 +0900 Subject: [PATCH] i18n is applied --- .../ucap-webmessenger-electron/src/index.ts | 6 +++--- .../src/app/app-translate.module.ts | 9 ++++++--- .../left-sidenav/group.component.html | 2 +- .../messenger-settings.dialog.component.ts | 3 +++ .../messenger/messenger.layout.module.ts | 4 ++++ .../src/app/services/app.service.ts | 6 +++--- .../src/app/store/setting/init/effects.ts | 4 ++++ .../src/assets/i18n/en.json | 18 +++++++++++++++++- .../src/assets/i18n/ko.json | 18 +++++++++++++++++- .../lib/services/electron-native.service.ts | 7 ++++++- .../src/lib/translate/electron-loader.ts | 2 +- 11 files changed, 65 insertions(+), 14 deletions(-) diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 28aad24a..c216f832 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -98,7 +98,7 @@ autoUpdater.autoDownload = false; autoUpdater.logger = log; const ucapMessengerLauncher = new AutoLaunch({ - name: app.getName() + name: app.name }); app.on(ElectronAppChannel.SecondInstance, (event, args, workingDirectory) => { @@ -412,9 +412,9 @@ ipcMain.on(FileChannel.ReadFile, (event: IpcMainEvent, ...args: any[]) => { try { fse.readFile(root(args[0]), (err, data) => { if (!!err) { - event.returnValue = null; + event.returnValue = err; } else { - event.returnValue = new Blob([data]); + event.returnValue = data; } }); } catch (error) { diff --git a/projects/ucap-webmessenger-app/src/app/app-translate.module.ts b/projects/ucap-webmessenger-app/src/app/app-translate.module.ts index 77a3fd70..b1518a9a 100644 --- a/projects/ucap-webmessenger-app/src/app/app-translate.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app-translate.module.ts @@ -4,10 +4,13 @@ import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native'; -export async function createTranslateLoader(nativeService: NativeService) { - // tslint:disable-next-line: variable-name +import { environment } from '../environments/environment'; + +export function createTranslateLoader(nativeService: NativeService) { const translateLoader = nativeService.getTranslateLoader( - './assets/i18n/', + environment.production + ? './assets/i18n/' + : '/projects/ucap-webmessenger-app/src/assets/i18n/', '.json' ); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index 3c70f82d..a37f29ba 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -1,6 +1,6 @@
-

그룹

+

{{ 'group.label' | translate }}