internationalization is processing

This commit is contained in:
병준 박 2020-01-03 16:17:23 +09:00
parent 5b308eaa6e
commit de8488912c
7 changed files with 117 additions and 45 deletions

View File

@ -15,6 +15,7 @@ import { take, map, finalize, tap } from 'rxjs/operators';
import { SnackBarService } from '@ucap-webmessenger/ui';
import { FileDownloadItem } from '@ucap-webmessenger/api';
import { CommonApiService } from '@ucap-webmessenger/api-common';
import { TranslateService } from '@ngx-translate/core';
export interface FileViewerDialogData {
fileInfo: FileEventJson;
@ -47,6 +48,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
>,
@Inject(MAT_DIALOG_DATA) public data: FileViewerDialogData,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private translateService: TranslateService,
private snackBarService: SnackBarService,
private commonApiService: CommonApiService,
private logger: NGXLogger
@ -96,20 +98,33 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
.saveFile(buffer, this.fileInfo.fileName, mimeType)
.then(result => {
if (!!result) {
this.snackBarService.open(
`파일이 경로[${result}]에 저장되었습니다.`,
'',
{
duration: 3000,
verticalPosition: 'bottom'
}
);
this.translateService
.get('common.file.savedToPath', {
v: result
})
.pipe(take(1))
.subscribe(v => {
this.snackBarService.open(v, '', {
duration: 3000,
verticalPosition: 'bottom'
});
});
} else {
this.snackBarService.open('파일 저장에 실패하였습니다.');
this.translateService
.get('common.file.failToSave')
.pipe(take(1))
.subscribe(v => {
this.snackBarService.open(v);
});
}
})
.catch(reason => {
this.snackBarService.open('파일 저장에 실패하였습니다.');
this.translateService
.get('common.file.failToSave')
.pipe(take(1))
.subscribe(v => {
this.snackBarService.open(v);
});
});
})
.catch(reason => {

View File

@ -1,6 +1,6 @@
<div>
<div class="current-head">
<h3>대화</h3>
<h3>{{ 'chat.label' | translate }}</h3>
<div class="btn-box">
<!-- <button mat-icon-button>
<mat-icon>timer</mat-icon>
@ -19,7 +19,7 @@
#inputSearch
type="text"
maxlength="20"
placeholder="대화방 이름 검색"
placeholder="{{ 'chat.searchRoomByName' | translate }}"
value=""
formControlName="searchInput"
[matAutocomplete]="auto"
@ -113,16 +113,21 @@
>
<ng-template matMenuContent let-roomInfo="roomInfo">
<button mat-menu-item (click)="onClickContextMenu('SELECT_ROOM', roomInfo)">
대화방 열기
{{ 'chat.openRoom' | translate }}
</button>
<button
mat-menu-item
(click)="onClickContextMenu('TOGGLE_ALARM', roomInfo)"
>
대화방 알람 {{ roomInfo.receiveAlarm ? '끄기' : '켜기' }}
{{
(roomInfo.receiveAlarm
? 'chat.turnOffRoomAlert'
: 'chat.turnOnRoomAlert'
) | translate
}}
</button>
<button mat-menu-item (click)="onClickContextMenu('EXIT_ROOM', roomInfo)">
대화방 나가기
{{ 'chat.leaveFromRoom' | translate }}
</button>
</ng-template>
</mat-menu>

View File

@ -25,7 +25,7 @@ import {
import * as AppStore from '@app/store';
import * as ChatStore from '@app/store/messenger/chat';
import * as RoomStore from '@app/store/messenger/room';
import { tap, debounceTime, delay } from 'rxjs/operators';
import { tap, debounceTime, delay, take } from 'rxjs/operators';
import {
RoomUserDetailData,
RoomUserData
@ -38,6 +38,7 @@ import { MatMenuTrigger } from '@angular/material';
import { FormGroup, FormBuilder } from '@angular/forms';
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-layout-chat-left-sidenav-chat',
@ -82,7 +83,8 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
private formBuilder: FormBuilder,
private logger: NGXLogger,
private dialogService: DialogService,
private sessionStorageService: SessionStorageService
private sessionStorageService: SessionStorageService,
private translateService: TranslateService
) {
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
KEY_VER_INFO
@ -239,7 +241,7 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
this.chatContextMenuTrigger.openMenu();
}
async onClickContextMenu(type: string, roomInfo: RoomInfo) {
onClickContextMenu(type: string, roomInfo: RoomInfo) {
switch (type) {
case 'SELECT_ROOM':
this.store.dispatch(
@ -251,20 +253,27 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
break;
case 'EXIT_ROOM':
{
const result = await this.dialogService.open<
ConfirmDialogComponent,
ConfirmDialogData,
ConfirmDialogResult
>(ConfirmDialogComponent, {
data: {
title: 'Exit Room',
html: `대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다.`
}
});
this.translateService
.get(['chat.leaveFromRoom', 'chat.confirmLeaveFromRoom'])
.pipe(take(1))
.subscribe(async values => {
const result = await this.dialogService.open<
ConfirmDialogComponent,
ConfirmDialogData,
ConfirmDialogResult
>(ConfirmDialogComponent, {
data: {
title: values['chat.leaveFromRoom'],
html: values['chat.confirmLeaveFromRoom']
}
});
if (!!result && !!result.choice && result.choice) {
this.store.dispatch(RoomStore.exit({ roomSeq: roomInfo.roomSeq }));
}
if (!!result && !!result.choice && result.choice) {
this.store.dispatch(
RoomStore.exit({ roomSeq: roomInfo.roomSeq })
);
}
});
}
break;
}

View File

@ -53,8 +53,10 @@
</div>
<div class="result-num">
검색결과<span class="text-accent-color"
>({{ searchUserInfos.length }}명)</span
{{ 'common.searchResult' | translate
}}<span class="text-accent-color"
>({{ searchUserInfos.length
}}{{ 'common.howManyPersons' | translate }})</span
>
</div>
<ucap-profile-user-list-item
@ -93,7 +95,7 @@
<line x1="20" y1="8" x2="20" y2="14"></line>
<line x1="23" y1="11" x2="17" y2="11"></line>
</svg>
<span>새 그룹 추가</span>
<span>{{ 'group.addNew' | translate }}</span>
</button>
<button mat-menu-item (click)="onClickGroupMenu('GROUP_EXPAND_MORE')">
<!--<mat-icon>expand_more</mat-icon>-->
@ -110,7 +112,7 @@
>
<path d="M6 9l6 6 6-6" />
</svg>
<span>그룹 전체 열기</span>
<span>{{ 'group.expandMore' | translate }}</span>
</button>
<button mat-menu-item (click)="onClickGroupMenu('GROUP_EXPAND_LESS')">
<!--<mat-icon>expand_less</mat-icon>-->
@ -127,7 +129,7 @@
>
<path d="M18 15l-6-6-6 6" />
</svg>
<span>그룹 전체 닫기</span>
<span>{{ 'group.expandLess' | translate }}</span>
</button>
<!-- <button mat-menu-item (click)="onClickGroupMenu('GROUP_SAVE')">
<mat-icon>save</mat-icon>
@ -161,7 +163,7 @@
mat-menu-item
(click)="onClickProfileContextMenu('VIEW_PROFILE', userInfo, group)"
>
프로필 보기
{{ 'profile.open' | translate }}
</button>
<button
mat-menu-item

View File

@ -110,9 +110,10 @@
<div class="result-num">
{{ 'common.searchResult' | translate }}
<span class="text-accent-color"
>({{ searchUserInfos.length }}명)</span
>
<span class="text-accent-color">
({{ searchUserInfos.length
}}{{ 'common.howManyPersons' | translate }})
</span>
</div>
<ucap-profile-user-list-item
*ngFor="let userInfo of searchUserInfos"
@ -194,7 +195,7 @@
</div>
<span *ngIf="isShowSelectedUserList"
>{{ selectedUserList.length }}
{{ 'common.howPersons' | translate }}</span
{{ 'common.howManyPersons' | translate }}</span
>
</div>
</mat-card-content>

View File

@ -4,7 +4,17 @@
"searchWord": "Search word",
"searchResult": "Search result",
"useOnlyForSpecialCharacter": "Can only use Special characters: {{v}}",
"howPersons": "person(s)",
"howManyPersons": "person(s)",
"file": {
"saved": "The file has been saved.",
"savedToPath": "The file has been saved to path[{{v}}].",
"failToSave": "File save failed."
},
"messages": {
"yes": "Yes",
"no": "No",
"confirm": "Confirm"
},
"timezone": {
"Africa/Abidjan": "Africa/Abidjan",
"Africa/Accra": "Africa/Accra",
@ -601,6 +611,9 @@
"Zulu": "Zulu"
}
},
"profile": {
"open": "Open profile"
},
"group": {
"label": "Group",
"addNew": "Add new group",
@ -612,9 +625,16 @@
"nameDefault": "Default"
},
"chat": {
"label": "Chat",
"room": "Chat room",
"searchRoomByName": "Search by room name",
"newTimerChat": "New Timer Chat",
"newChat": "New Chat"
"newChat": "New Chat",
"openRoom": "Open room",
"turnOnRoomAlert": "turn on room alert",
"turnOffRoomAlert": "turn off room alert",
"leaveFromRoom": "leave room",
"confirmLeaveFromRoom": "Are you sure you want to leave the chat room?<br/>Leave your chat history and chat room information."
},
"organization": {
"chart": "Organization chart"

View File

@ -4,7 +4,17 @@
"searchWord": "검색어",
"searchResult": "검색 결과",
"useOnlyForSpecialCharacter": "특수문자는 {{v}}만 사용할 수 있습니다.",
"howPersons": "명",
"howManyPersons": "명",
"file": {
"saved": "파일이 저장되었습니다.",
"savedToPath": "파일이 경로[{{v}}]에 저장되었습니다.",
"failToSave": "파일 저장에 실패하였습니다."
},
"messages": {
"yes": "네",
"no": "아니오",
"confirm": "확인"
},
"timezone": {
"Africa/Abidjan": "아프리카/아비 장",
"Africa/Accra": "아프리카/아크라",
@ -601,6 +611,9 @@
"Zulu": "줄루"
}
},
"profile": {
"open": "프로필 보기"
},
"group": {
"label": "그룹",
"addNew": "새 그룹 추가",
@ -612,9 +625,16 @@
"nameDefault": "기본"
},
"chat": {
"label": "대화",
"room": "대화방",
"searchRoomByName": "대화방 이름 검색",
"newTimerChat": "새로운 타이머 대화",
"newChat": "새로운 대화"
"newChat": "새로운 대화",
"openRoom": "대화방 열기",
"turnOnRoomAlert": "대화방 알람 켜기",
"turnOffRoomAlert": "대화방 알람 끄기",
"leaveFromRoom": "대화방 나가기",
"confirmLeaveFromRoom": "대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다."
},
"organization": {
"chart": "조직도"