i18n is working

This commit is contained in:
Richard Park 2020-01-07 11:36:25 +09:00
parent 35e61706da
commit 53b82fa809
9 changed files with 610 additions and 458 deletions

View File

@ -99,7 +99,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.results.savedToPath', {
path: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
@ -111,7 +111,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
}); });
} else { } else {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);
@ -120,7 +120,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
}) })
.catch(reason => { .catch(reason => {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);

View File

@ -140,7 +140,7 @@
}} }}
</button> </button>
<button mat-menu-item (click)="onClickContextMenu('EXIT_ROOM', roomInfo)"> <button mat-menu-item (click)="onClickContextMenu('EXIT_ROOM', roomInfo)">
{{ 'chat.leaveFromRoom' | translate }} {{ 'chat.exitFromRoom' | translate }}
</button> </button>
</ng-template> </ng-template>
</mat-menu> </mat-menu>

View File

@ -258,7 +258,7 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
case 'EXIT_ROOM': case 'EXIT_ROOM':
{ {
this.translateService this.translateService
.get(['chat.leaveFromRoom', 'chat.confirmLeaveFromRoom']) .get(['chat.exitFromRoom', 'chat.confirmExitFromRoom'])
.pipe(take(1)) .pipe(take(1))
.subscribe(async values => { .subscribe(async values => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
@ -267,8 +267,8 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
ConfirmDialogResult ConfirmDialogResult
>(ConfirmDialogComponent, { >(ConfirmDialogComponent, {
data: { data: {
title: values['chat.leaveFromRoom'], title: values['chat.exitFromRoom'],
html: values['chat.confirmLeaveFromRoom'] html: values['chat.confirmExitFromRoom']
} }
}); });

View File

@ -131,56 +131,56 @@
*ngIf="getShowContextMenu('OPEN_ALBUM_LIST')" *ngIf="getShowContextMenu('OPEN_ALBUM_LIST')"
(click)="onClickContextMenu('OPEN_ALBUM_LIST')" (click)="onClickContextMenu('OPEN_ALBUM_LIST')"
> >
앨범함 {{ 'chat.albumBox.label' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('OPEN_FILE_LIST')" *ngIf="getShowContextMenu('OPEN_FILE_LIST')"
(click)="onClickContextMenu('OPEN_FILE_LIST')" (click)="onClickContextMenu('OPEN_FILE_LIST')"
> >
파일함 {{ 'chat.fileBox.label' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('CHAT_SEARCH')" *ngIf="getShowContextMenu('CHAT_SEARCH')"
(click)="onClickContextMenu('CHAT_SEARCH')" (click)="onClickContextMenu('CHAT_SEARCH')"
> >
대화내용 검색 {{ 'chat.searchEventByText' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('OPEN_ROOM_USER')" *ngIf="getShowContextMenu('OPEN_ROOM_USER')"
(click)="onClickContextMenu('OPEN_ROOM_USER')" (click)="onClickContextMenu('OPEN_ROOM_USER')"
> >
대화참여자목록 {{ 'chat.listOfRoomMember' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('ADD_MEMBER')" *ngIf="getShowContextMenu('ADD_MEMBER')"
(click)="onClickContextMenu('ADD_MEMBER')" (click)="onClickContextMenu('ADD_MEMBER')"
> >
대화상대추가 {{ 'chat.addMemberToRoom' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('ADD_GROUP')" *ngIf="getShowContextMenu('ADD_GROUP')"
(click)="onClickContextMenu('ADD_GROUP')" (click)="onClickContextMenu('ADD_GROUP')"
> >
그룹멤버로추가 {{ 'chat.addMemberToGroup' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('EDIT_ROOM')" *ngIf="getShowContextMenu('EDIT_ROOM')"
(click)="onClickContextMenu('EDIT_ROOM')" (click)="onClickContextMenu('EDIT_ROOM')"
> >
대화방설정 {{ 'chat.settingsOfRoom' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="getShowContextMenu('CLOSE_ROOM')" *ngIf="getShowContextMenu('CLOSE_ROOM')"
(click)="onClickContextMenu('CLOSE_ROOM')" (click)="onClickContextMenu('CLOSE_ROOM')"
> >
방닫기 {{ 'chat.closeRoom' | translate }}
</button> </button>
</mat-menu> </mat-menu>
</div> </div>
@ -330,34 +330,34 @@
*ngIf="isCopyableMessage(message.type)" *ngIf="isCopyableMessage(message.type)"
(click)="onClickMessageContextMenu('COPY', message)" (click)="onClickMessageContextMenu('COPY', message)"
> >
대화 복사 {{ 'chat.copyChatText' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)" *ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
(click)="onClickMessageContextMenu('REPLAY', message)" (click)="onClickMessageContextMenu('REPLAY', message)"
> >
대화 전달 {{ 'chat.forwardEventTo' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)" *ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
(click)="onClickMessageContextMenu('REPLAY_TO_ME', message)" (click)="onClickMessageContextMenu('REPLAY_TO_ME', message)"
> >
대화 나에게 전달 {{ 'chat.forwardEventToMe' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
(click)="onClickMessageContextMenu('DELETE', message)" (click)="onClickMessageContextMenu('DELETE', message)"
> >
대화 삭제 {{ 'chat.removeEvent' | translate }}
</button> </button>
<button <button
mat-menu-item mat-menu-item
*ngIf="isRecallableMessage(message, loginRes.userSeq)" *ngIf="isRecallableMessage(message, loginRes.userSeq)"
(click)="onClickMessageContextMenu('RECALL', message)" (click)="onClickMessageContextMenu('RECALL', message)"
> >
대화 회수 {{ 'chat.recallEvent' | translate }}
</button> </button>
</ng-container> </ng-container>
</ng-template> </ng-template>

View File

@ -109,6 +109,7 @@ import {
MassDetailDialogData MassDetailDialogData
} from '../dialogs/chat/mass-detail.component'; } from '../dialogs/chat/mass-detail.component';
import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
selector: 'app-layout-messenger-messages', selector: 'app-layout-messenger-messages',
@ -204,6 +205,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
private localStorageService: LocalStorageService, private localStorageService: LocalStorageService,
private commonApiService: CommonApiService, private commonApiService: CommonApiService,
private clipboardService: ClipboardService, private clipboardService: ClipboardService,
private translateService: TranslateService,
private dialogService: DialogService, private dialogService: DialogService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
@ -613,22 +615,28 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
} }
/** Send Event */ /** Send Event */
async onSendMessage(message: string) { onSendMessage(message: string) {
this.setEventMoreInit(); this.setEventMoreInit();
if (!this.selectedSticker) { if (!this.selectedSticker) {
if (!message || message.trim().length === 0) { if (!message || message.trim().length === 0) {
const result = await this.dialogService.open< this.translateService
AlertDialogComponent, .get(['chat.errors.label', 'chat.errors.inputChatMessage'])
AlertDialogData, .pipe(take(1))
AlertDialogResult .subscribe(async vs => {
>(AlertDialogComponent, { const result = await this.dialogService.open<
width: '360px', AlertDialogComponent,
data: { AlertDialogData,
title: 'Alert', AlertDialogResult
message: `대화내용을 입력해주세요.` >(AlertDialogComponent, {
} width: '360px',
}); data: {
title: vs['chat.errors.label'],
message: vs['chat.errors.inputChatMessage']
}
});
});
return; return;
} }
} }
@ -730,17 +738,24 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
message.trim().length > message.trim().length >
environment.productConfig.CommonSetting.masstextLength environment.productConfig.CommonSetting.masstextLength
) { ) {
const result = await this.dialogService.open< this.translateService
AlertDialogComponent, .get(['chat.errors.label', 'chat.errors.maxLengthOfMassText'], {
AlertDialogData, maxLength: environment.productConfig.CommonSetting.masstextLength
AlertDialogResult })
>(AlertDialogComponent, { .pipe(take(1))
width: '360px', .subscribe(async vs => {
data: { const result = await this.dialogService.open<
title: 'Alert', AlertDialogComponent,
message: `스티커를 포함할 경우 ${environment.productConfig.CommonSetting.masstextLength}자 이상 보낼 수 없습니다.` AlertDialogData,
} AlertDialogResult
}); >(AlertDialogComponent, {
width: '360px',
data: {
title: vs['chat.errors.label'],
message: vs['chat.errors.maxLengthOfMassText']
}
});
});
return; return;
} }
@ -856,20 +871,31 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}) { }) {
this.logger.debug('fileSave', value); this.logger.debug('fileSave', value);
if (value.type === 'saveAs') { if (value.type === 'saveAs') {
this.nativeService this.translateService
.selectSaveFilePath(value.fileInfo.fileName) .get([
.then(result => { 'common.file.errors.label',
if (!!result && result.length > 0) { 'common.file.errors.failToSpecifyPath'
this.saveFile(value, result); ])
} else { .pipe(take(1))
this.snackBarService.open( .subscribe(vs => {
'저장경로 지정에 실패하였습니다.', this.nativeService
'확인' .selectSaveFilePath(value.fileInfo.fileName)
); .then(result => {
} if (!!result && result.length > 0) {
}) this.saveFile(value, result);
.catch(reason => { } else {
this.snackBarService.open('저장경로 지정에 실패하였습니다.', '확인'); this.snackBarService.open(
vs['common.file.errors.failToSpecifyPath'],
vs['common.file.errors.label']
);
}
})
.catch(reason => {
this.snackBarService.open(
vs['common.file.errors.failToSpecifyPath'],
vs['common.file.errors.label']
);
});
}); });
} else { } else {
this.saveFile(value); this.saveFile(value);
@ -919,26 +945,33 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
.saveFile(buffer, value.fileInfo.fileName, mimeType, savePath) .saveFile(buffer, value.fileInfo.fileName, mimeType, savePath)
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.snackBarService.open( this.translateService
`파일이 경로[${result}]에 저장되었습니다.`, .get('common.file.results.savedToPath', {
'', path: result
{ })
duration: 3000, .pipe(take(1))
verticalPosition: 'bottom' .subscribe(v => {
} this.snackBarService.open(v, '', {
); duration: 3000,
verticalPosition: 'bottom'
});
});
} else { } else {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.errors.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
} }
}) })
.catch(reason => { .catch(reason => {
this.snackBarService.open( this.translateService
'파일 저장에 실패하였습니다.', .get('common.file.errors.failToSave')
'확인' .pipe(take(1))
); .subscribe(v => {
this.snackBarService.open(v);
});
}); });
}) })
.catch(reason => { .catch(reason => {
@ -1036,18 +1069,19 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}, },
error => { error => {
this.logger.debug('onFileSelected error', error); this.logger.debug('onFileSelected error', error);
this.fileUploadQueue.onUploadComplete();
this.dialogService.open< this.translateService
AlertDialogComponent, .get([
AlertDialogData, 'common.file.errors.label',
AlertDialogResult 'common.file.errors.failToUpload'
>(AlertDialogComponent, { ])
data: { .pipe(take(1))
title: 'Alert', .subscribe(vs => {
html: `파일전송에 실패하였습니다.<br/>계속 문제 발생 시 관리자에게 문의하세요.` this.snackBarService.open(
} vs['common.file.errors.failToUpload'],
}); vs['common.file.errors.label']
);
});
}, },
() => { () => {
this.fileUploadQueue.onUploadComplete(); this.fileUploadQueue.onUploadComplete();
@ -1072,7 +1106,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.messageContextMenuTrigger.openMenu(); this.messageContextMenuTrigger.openMenu();
} }
async onClickMessageContextMenu(menuType: string, message: Info<EventJson>) { onClickMessageContextMenu(menuType: string, message: Info<EventJson>) {
switch (menuType) { switch (menuType) {
case 'COPY': case 'COPY':
{ {
@ -1084,11 +1118,20 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
(message as Info<string>).sentMessage (message as Info<string>).sentMessage
) )
) { ) {
this.snackBarService.open('클립보드에 복사되었습니다.', '', { this.translateService
duration: 3000, .get(['common.clipboard.results.copied'])
verticalPosition: 'top', .pipe(take(1))
horizontalPosition: 'center' .subscribe(async vs => {
}); this.snackBarService.open(
vs['common.clipboard.results.copied'],
'',
{
duration: 3000,
verticalPosition: 'top',
horizontalPosition: 'center'
}
);
});
} }
} }
break; break;
@ -1104,15 +1147,20 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
.pipe(take(1)) .pipe(take(1))
.subscribe(res => { .subscribe(res => {
if (this.clipboardService.copyFromContent(res.content)) { if (this.clipboardService.copyFromContent(res.content)) {
this.snackBarService.open( this.translateService
'클립보드에 복사되었습니다.', .get(['common.clipboard.results.copied'])
'', .pipe(take(1))
{ .subscribe(async vs => {
duration: 3000, this.snackBarService.open(
verticalPosition: 'top', vs['common.clipboard.results.copied'],
horizontalPosition: 'center' '',
} {
); duration: 3000,
verticalPosition: 'top',
horizontalPosition: 'center'
}
);
});
} }
}); });
} }
@ -1125,48 +1173,53 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
break; break;
case 'REPLAY': case 'REPLAY':
{ {
const result = await this.dialogService.open< this.translateService
CreateChatDialogComponent, .get(['chat.forwardEventTo'])
CreateChatDialogData, .pipe(take(1))
CreateChatDialogResult .subscribe(async vs => {
>(CreateChatDialogComponent, { const result = await this.dialogService.open<
width: '600px', CreateChatDialogComponent,
data: { CreateChatDialogData,
type: UserSelectDialogType.MessageForward, CreateChatDialogResult
title: 'MessageForward', >(CreateChatDialogComponent, {
ignoreRoom: [this.roomInfo] width: '600px',
} data: {
}); type: UserSelectDialogType.MessageForward,
title: vs['chat.forwardEventTo'],
ignoreRoom: [this.roomInfo]
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = []; const userSeqs: number[] = [];
let roomSeq = ''; let roomSeq = '';
if ( if (
!!result.selectedUserList && !!result.selectedUserList &&
result.selectedUserList.length > 0 result.selectedUserList.length > 0
) { ) {
result.selectedUserList.map(user => userSeqs.push(user.seq)); result.selectedUserList.map(user => userSeqs.push(user.seq));
} }
if (!!result.selectedRoom) { if (!!result.selectedRoom) {
roomSeq = result.selectedRoom.roomSeq; roomSeq = result.selectedRoom.roomSeq;
} }
if (userSeqs.length > 0 || roomSeq.trim().length > 0) { if (userSeqs.length > 0 || roomSeq.trim().length > 0) {
this.store.dispatch( this.store.dispatch(
EventStore.forward({ EventStore.forward({
senderSeq: this.loginRes.userSeq, senderSeq: this.loginRes.userSeq,
req: { req: {
roomSeq: '-999', roomSeq: '-999',
eventType: message.type, eventType: message.type,
sentMessage: message.sentMessage sentMessage: message.sentMessage
}, },
trgtUserSeqs: userSeqs, trgtUserSeqs: userSeqs,
trgtRoomSeq: roomSeq trgtRoomSeq: roomSeq
}) })
); );
} }
} }
});
} }
break; break;
case 'REPLAY_TO_ME': case 'REPLAY_TO_ME':
@ -1188,51 +1241,61 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
break; break;
case 'DELETE': case 'DELETE':
{ {
const result = await this.dialogService.open< this.translateService
ConfirmDialogComponent, .get(['chat.removeEvent', 'chat.confirmRemoveEvent'])
ConfirmDialogData, .pipe(take(1))
ConfirmDialogResult .subscribe(async vs => {
>(ConfirmDialogComponent, { const result = await this.dialogService.open<
width: '400px', ConfirmDialogComponent,
data: { ConfirmDialogData,
title: 'Delete', ConfirmDialogResult
html: `선택한 메시지를 삭제하시겠습니까?<br/>삭제된 메시지는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.` >(ConfirmDialogComponent, {
} width: '400px',
}); data: {
title: vs['chat.removeEvent'],
html: vs['chat.confirmRemoveEvent']
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
this.store.dispatch( this.store.dispatch(
EventStore.del({ EventStore.del({
roomSeq: this.roomInfo.roomSeq, roomSeq: this.roomInfo.roomSeq,
eventSeq: message.seq eventSeq: message.seq
}) })
); );
} }
});
} }
break; break;
case 'RECALL': case 'RECALL':
{ {
const result = await this.dialogService.open< this.translateService
ConfirmDialogComponent, .get(['chat.recallEvent', 'chat.confirmRecallEvent'])
ConfirmDialogData, .pipe(take(1))
ConfirmDialogResult .subscribe(async vs => {
>(ConfirmDialogComponent, { const result = await this.dialogService.open<
width: '400px', ConfirmDialogComponent,
data: { ConfirmDialogData,
title: 'ReCall', ConfirmDialogResult
html: `해당 대화를 회수하시겠습니까?<br/>상대방 대화창에서도 회수됩니다.` >(ConfirmDialogComponent, {
} width: '400px',
}); data: {
title: vs['chat.recallEvent'],
html: vs['chat.confirmRecallEvent']
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
this.store.dispatch( this.store.dispatch(
EventStore.cancel({ EventStore.cancel({
roomSeq: this.roomInfo.roomSeq, roomSeq: this.roomInfo.roomSeq,
eventSeq: message.seq, eventSeq: message.seq,
deviceType: this.environmentsInfo.deviceType deviceType: this.environmentsInfo.deviceType
}) })
); );
} }
});
} }
break; break;
default: default:
@ -1240,7 +1303,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
} }
} }
async onClickContextMenu(menuType: string) { onClickContextMenu(menuType: string) {
switch (menuType) { switch (menuType) {
case 'OPEN_ALBUM_LIST': case 'OPEN_ALBUM_LIST':
{ {
@ -1276,134 +1339,153 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
break; break;
case 'ADD_MEMBER': case 'ADD_MEMBER':
{ {
const result = await this.dialogService.open< this.translateService
CreateChatDialogComponent, .get(['chat.modifyRoomMember'])
CreateChatDialogData, .pipe(take(1))
CreateChatDialogResult .subscribe(async vs => {
>(CreateChatDialogComponent, { const result = await this.dialogService.open<
width: '600px', CreateChatDialogComponent,
data: { CreateChatDialogData,
type: UserSelectDialogType.EditChatMember, CreateChatDialogResult
title: 'Edit Chat Member', >(CreateChatDialogComponent, {
curRoomUser: this.userInfoList.filter( width: '600px',
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom data: {
) type: UserSelectDialogType.EditChatMember,
} title: vs['chat.modifyRoomMember'],
}); curRoomUser: this.userInfoList.filter(
user =>
if (!!result && !!result.choice && result.choice) { user.seq !== this.loginRes.userSeq && user.isJoinRoom
const userSeqs: number[] = this.userInfoList.map(userInfo => { )
if (userInfo.isJoinRoom) {
return userInfo.seq;
}
});
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0
) {
result.selectedUserList.forEach(user => {
if (userSeqs.indexOf(user.seq) < 0) {
userSeqs.push(user.seq);
} }
}); });
}
if (userSeqs.length > 0) { if (!!result && !!result.choice && result.choice) {
// include me const userSeqs: number[] = this.userInfoList.map(userInfo => {
userSeqs.push(this.loginRes.userSeq); if (userInfo.isJoinRoom) {
return userInfo.seq;
this.store.dispatch(
RoomStore.inviteOrOpen({
req: {
divCd: 'Invite',
userSeqs
} }
}) });
); if (
} !!result.selectedUserList &&
} result.selectedUserList.length > 0
) {
result.selectedUserList.forEach(user => {
if (userSeqs.indexOf(user.seq) < 0) {
userSeqs.push(user.seq);
}
});
}
if (userSeqs.length > 0) {
// include me
userSeqs.push(this.loginRes.userSeq);
this.store.dispatch(
RoomStore.inviteOrOpen({
req: {
divCd: 'Invite',
userSeqs
}
})
);
}
}
});
} }
break; break;
case 'ADD_GROUP': case 'ADD_GROUP':
{ {
const result = await this.dialogService.open< this.translateService
SelectGroupDialogComponent, .get(['chat.addMemberToGroup'])
SelectGroupDialogData, .pipe(take(1))
SelectGroupDialogResult .subscribe(async vs => {
>(SelectGroupDialogComponent, { const result = await this.dialogService.open<
width: '600px', SelectGroupDialogComponent,
data: { SelectGroupDialogData,
title: 'Group Select' SelectGroupDialogResult
} >(SelectGroupDialogComponent, {
}); width: '600px',
data: {
title: vs['chat.addMemberToGroup']
}
});
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
if (!!result.group) { if (!!result.group) {
const oldGroup: GroupDetailData = result.group; const oldGroup: GroupDetailData = result.group;
const trgtUserSeq: number[] = []; const trgtUserSeq: number[] = [];
result.group.userSeqs.map(seq => trgtUserSeq.push(seq)); result.group.userSeqs.map(seq => trgtUserSeq.push(seq));
this.userInfoList this.userInfoList
.filter(v => result.group.userSeqs.indexOf(v.seq) < 0) .filter(v => result.group.userSeqs.indexOf(v.seq) < 0)
.forEach(user => { .forEach(user => {
trgtUserSeq.push(user.seq); trgtUserSeq.push(user.seq);
}); });
this.store.dispatch( this.store.dispatch(
SyncStore.updateGroupMember({ SyncStore.updateGroupMember({
oldGroup, oldGroup,
trgtUserSeq trgtUserSeq
}) })
); );
} }
} }
});
} }
break; break;
case 'EDIT_ROOM': case 'EDIT_ROOM':
{ {
const result = await this.dialogService.open< this.translateService
EditChatRoomDialogComponent, .get(['chat.settingsOfRoom'])
EditChatRoomDialogData, .pipe(take(1))
EditChatRoomDialogResult .subscribe(async vs => {
>(EditChatRoomDialogComponent, { const result = await this.dialogService.open<
width: '600px', EditChatRoomDialogComponent,
data: { EditChatRoomDialogData,
title: 'Edit Chat Room', EditChatRoomDialogResult
roomInfo: this.roomInfo >(EditChatRoomDialogComponent, {
} width: '600px',
}); data: {
title: vs['chat.settingsOfRoom'],
if (!!result && !!result.choice && result.choice) { roomInfo: this.roomInfo
const roomName: string = result.roomName;
const roomNameChangeTarget: string = result.roomNameChangeTarget;
const timeRoomInterval: number = result.timeRoomInterval;
const roomInfo: RoomInfo = result.roomInfo;
// 방제목 업데이트.
this.store.dispatch(
RoomStore.update({
req: {
roomSeq: roomInfo.roomSeq,
roomName,
receiveAlarm: roomInfo.receiveAlarm,
syncAll:
roomNameChangeTarget.toUpperCase() === 'ALL' ? true : false
} }
}) });
);
if ( if (!!result && !!result.choice && result.choice) {
roomInfo.isTimeRoom && const roomName: string = result.roomName;
timeRoomInterval > 0 && const roomNameChangeTarget: string =
roomInfo.timeRoomInterval !== timeRoomInterval result.roomNameChangeTarget;
) { const timeRoomInterval: number = result.timeRoomInterval;
this.store.dispatch( const roomInfo: RoomInfo = result.roomInfo;
RoomStore.updateTimeRoomInterval({
roomSeq: roomInfo.roomSeq, // 방제목 업데이트.
timerInterval: timeRoomInterval this.store.dispatch(
}) RoomStore.update({
); req: {
} roomSeq: roomInfo.roomSeq,
} roomName,
receiveAlarm: roomInfo.receiveAlarm,
syncAll:
roomNameChangeTarget.toUpperCase() === 'ALL'
? true
: false
}
})
);
if (
roomInfo.isTimeRoom &&
timeRoomInterval > 0 &&
roomInfo.timeRoomInterval !== timeRoomInterval
) {
this.store.dispatch(
RoomStore.updateTimeRoomInterval({
roomSeq: roomInfo.roomSeq,
timerInterval: timeRoomInterval
})
);
}
}
});
} }
break; break;
case 'CLOSE_ROOM': case 'CLOSE_ROOM':

View File

@ -233,7 +233,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.results.savedToPath', {
path: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
@ -245,7 +245,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
}); });
} else { } else {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);
@ -254,7 +254,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
}) })
.catch(reason => { .catch(reason => {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);

View File

@ -277,7 +277,7 @@ export class FileBoxComponent implements OnInit, OnDestroy {
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.results.savedToPath', {
path: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
@ -289,7 +289,7 @@ export class FileBoxComponent implements OnInit, OnDestroy {
}); });
} else { } else {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);
@ -298,7 +298,7 @@ export class FileBoxComponent implements OnInit, OnDestroy {
}) })
.catch(reason => { .catch(reason => {
this.translateService this.translateService
.get('common.file.failToSave') .get('common.file.errors.failToSave')
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {
this.snackBarService.open(v); this.snackBarService.open(v);

View File

@ -1,4 +1,105 @@
{ {
"profile": {
"open": "Open profile"
},
"group": {
"label": "Group",
"addNew": "Add new group",
"expandMore": "Expand all groups",
"expandLess": "Collapse all groups",
"name": "Group name",
"nameFavorit": "Favorit",
"nameMyDept": "My Dept",
"nameDefault": "Default",
"favorite": "Favorite",
"unfavorite": "Unfavorite",
"removeBuddyFromGroup": "Remove buddy from group",
"copyBuddyToGroup": "Copy buddy to other group",
"moveBuddyToGroup": "Move buddy to otyer group",
"changeGroupName": "Change name of group",
"modifyGroupMember": "Modify member of group",
"removeGroup": "Remove group",
"startChatWithGroup": "Chat with group",
"sendMessageToGroup": "Send message to group",
"selectTargetGroup": "Select target group"
},
"chat": {
"label": "Chat",
"room": "Chat room",
"searchRoomByName": "Search by room name",
"searchEventByText": "Search by chat",
"newTimerChat": "New Timer Chat",
"newChat": "New Chat",
"startChat": "Chat",
"openRoom": "Open room",
"listOfRoomMember": "List of room member",
"settingsOfRoom": "Settings of room",
"turnOnRoomAlert": "Turn on room alert",
"turnOffRoomAlert": "Turn off room alert",
"exitFromRoom": "Exit room",
"closeRoom": "Close room",
"confirmExitFromRoom": "Do you want to exit the chat room?<br/>Exiting will delete your chat history and chat room information.",
"confirmDeleteFile": "Do you want to delete the file?<br/>The deleted file (message) will only be applied to your chat room and will not be deleted from their chat room.",
"confirmRemoveEvent": "Do you want to delete the chat?<br/>Deleted messages apply only to your chat room and are not deleted from their chat rooms.",
"confirmRecallEvent": "Do you want to recall the chat?<br/>It is also retrieved from the other party's chat window.",
"typeReceived": "Received",
"typeSent": "Sent",
"sentDate": "Sent date",
"validityPeriod": "Validity period",
"forwardEventToMe": "Forward chat to me",
"forwardEventTo": "Forward chat to ...",
"forwardFileToMe": "Forward file to me",
"forwardFileTo": "Forward file to ...",
"addMemberToRoom": "Add member to room",
"addMemberToGroup": "Add member to group",
"copyChatText": "Copy chat",
"removeEvent": "Remove chat",
"recallEvent": "Recall chat",
"modifyRoomMember": "Modify chat room member",
"ejectFromRoom": "Eject from room",
"confirmEjectFromRoom": "Do you want to eject member[{{targetMember}}] from room?",
"badgeDescriptionForUnread": "There is an unconfirmed message.",
"albumBox": {
"label": "Album box"
},
"fileBox": {
"label": "File box"
},
"errors": {
"label": "Chat erros",
"inputChatMessage": "Please enter a chat message",
"maxLengthOfMassText": "If you include a sticker, you can't send more than {{maxLength}} characters."
},
"detailView": "Detail View"
},
"organization": {
"chart": "Organization chart",
"addToGroup": "Add to group",
"startChat": "Chat",
"startVideoConference": "Video conference",
"makeExtensionCall": "Make extension call",
"makeMobileCall": "Make mobile call",
"sendMessage": "Send message",
"sendSMS": "Send SMS"
},
"message": {
"label": "Message",
"newMessage": "New message",
"sendTo": "Send message",
"placeholderForSearch": "search for name, title, content",
"messageTypeAll": "All",
"messageTypeReceiving": "Receiving",
"messageTypeOutgoing": "Outgoing",
"messageTypeReservation": "Reservation",
"searchTypeName": "Name",
"searchTypeTitle": "Title",
"searchTypeContent": "Content",
"badgeDescriptionForUnread": "There is an unconfirmed message."
},
"notice": {
"fieldTitle": "Title",
"fieldPostDate": "Post date"
},
"common": { "common": {
"search": "Search", "search": "Search",
"searchWord": "Search word", "searchWord": "Search word",
@ -10,9 +111,6 @@
"size": "Size of file", "size": "Size of file",
"download": "Download", "download": "Download",
"delete": "Delete", "delete": "Delete",
"saved": "The file has been saved.",
"savedToPath": "The file has been saved to path[{{v}}].",
"failToSave": "File save failed.",
"downloadSelected": "Download selected", "downloadSelected": "Download selected",
"openDownloadFolder": "Open download folder", "openDownloadFolder": "Open download folder",
"selectFiles": "Select files", "selectFiles": "Select files",
@ -20,6 +118,21 @@
"label": "Type of file", "label": "Type of file",
"images": "Images", "images": "Images",
"video": "Video" "video": "Video"
},
"results": {
"saved": "The file has been saved.",
"savedToPath": "The file has been saved to path[{{path}}]."
},
"errors": {
"label": "File errors",
"failToUpload": "File upload failed.",
"failToSave": "File save failed.",
"failToSpecifyPath": "Specifing of save path failed."
}
},
"clipboard": {
"results": {
"copied": "Copied to clipboard."
} }
}, },
"messages": { "messages": {
@ -632,83 +745,5 @@
"WET": "WET", "WET": "WET",
"Zulu": "Zulu" "Zulu": "Zulu"
} }
},
"profile": {
"open": "Open profile"
},
"group": {
"label": "Group",
"addNew": "Add new group",
"expandMore": "Expand all groups",
"expandLess": "Collapse all groups",
"name": "Group name",
"nameFavorit": "Favorit",
"nameMyDept": "My Dept",
"nameDefault": "Default",
"favorite": "Favorite",
"unfavorite": "Unfavorite",
"removeBuddyFromGroup": "Remove buddy from group",
"copyBuddyToGroup": "Copy buddy to other group",
"moveBuddyToGroup": "Move buddy to otyer group",
"changeGroupName": "Change name of group",
"modifyGroupMember": "Modify member of group",
"removeGroup": "Remove group",
"startChatWithGroup": "Chat with group",
"sendMessageToGroup": "Send message to group",
"selectTargetGroup": "Select target group"
},
"chat": {
"label": "Chat",
"room": "Chat room",
"searchRoomByName": "Search by room name",
"newTimerChat": "New Timer Chat",
"newChat": "New Chat",
"startChat": "Chat",
"openRoom": "Open room",
"turnOnRoomAlert": "turn on room alert",
"turnOffRoomAlert": "turn off room alert",
"leaveFromRoom": "leave room",
"confirmLeaveFromRoom": "Do you want to leave the chat room?<br/>Leave your chat history and chat room information.",
"confirmDeleteFile": "Do you want to delete the file?<br/>The deleted file (message) will only be applied to your chat room and will not be deleted from their chat room.",
"typeReceived": "Received",
"typeSent": "Sent",
"sentDate": "Sent date",
"validityPeriod": "Validity period",
"forwardFileToMe": "Forward file to me",
"forwardFileTo": "Forward file to ...",
"addMemberToRoom": "Add member to room",
"addMemberToGroup": "Add member to group",
"modifyRoomMember": "Modify chat room member",
"ejectFromRoom": "Eject from room",
"confirmEjectFromRoom": "Do you want to eject member[{{targetMember}}] from room?",
"badgeDescriptionForUnread": "There is an unconfirmed message."
},
"organization": {
"chart": "Organization chart",
"addToGroup": "Add to group",
"startChat": "Chat",
"startVideoConference": "Video conference",
"makeExtensionCall": "Make extension call",
"makeMobileCall": "Make mobile call",
"sendMessage": "Send message",
"sendSMS": "Send SMS"
},
"message": {
"label": "Message",
"newMessage": "New message",
"sendTo": "Send message",
"placeholderForSearch": "search for name, title, content",
"messageTypeAll": "All",
"messageTypeReceiving": "Receiving",
"messageTypeOutgoing": "Outgoing",
"messageTypeReservation": "Reservation",
"searchTypeName": "Name",
"searchTypeTitle": "Title",
"searchTypeContent": "Content",
"badgeDescriptionForUnread": "There is an unconfirmed message."
},
"notice": {
"fieldTitle": "Title",
"fieldPostDate": "Post date"
} }
} }

View File

@ -1,4 +1,105 @@
{ {
"profile": {
"open": "프로필 보기"
},
"group": {
"label": "그룹",
"addNew": "새 그룹 추가",
"expandMore": "그룹 전체 열기",
"expandLess": "그룹 전체 닫기",
"name": "그룹 이름",
"nameFavorit": "즐겨찾기",
"nameMyDept": "소속부서",
"nameDefault": "기본",
"favorite": "즐겨찾기 등록",
"unfavorite": "즐겨찾기 해제",
"removeBuddyFromGroup": "이 그룹에서 삭제",
"copyBuddyToGroup": "대화 상대 복사",
"moveBuddyToGroup": "대화 상대 이동",
"changeGroupName": "그룹 이름 바꾸기",
"modifyGroupMember": "그룹 멤버 변경",
"removeGroup": "그룹 삭제",
"startChatWithGroup": "그룹 대화하기",
"sendMessageToGroup": "그룹 쪽지 보내기",
"selectTargetGroup": "대상 그룹 선택"
},
"chat": {
"label": "대화",
"room": "대화방",
"searchRoomByName": "대화방 이름 검색",
"searchEventByText": "대화 내용 검색",
"newTimerChat": "새로운 타이머 대화",
"newChat": "새로운 대화",
"startChat": "대화하기",
"openRoom": "대화방 열기",
"listOfRoomMember": "대화 참여자 목록",
"settingsOfRoom": "대화방 설정",
"turnOnRoomAlert": "대화방 알람 켜기",
"turnOffRoomAlert": "대화방 알람 끄기",
"exitFromRoom": "대화방 나가기",
"closeRoom": "방 닫기",
"confirmExitFromRoom": "대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다.",
"confirmDeleteFile": "선택한 파일(메시지)를 삭제하시겠습니까?<br/>삭제된 파일(메시지)는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.",
"confirmRemoveEvent": "선택한 메시지를 삭제하시겠습니까?<br/>삭제된 메시지는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.",
"confirmRecallEvent": "해당 대화를 회수하시겠습니까?<br/>상대방 대화창에서도 회수됩니다.",
"typeReceived": "수신",
"typeSent": "발신",
"sentDate": "보낸 날짜",
"validityPeriod": "유효 기간",
"forwardEventToMe": "대화 나에게 전달",
"forwardEventTo": "대화 전달",
"forwardFileToMe": "파일을 나에게 전달",
"forwardFileTo": "파일 전달",
"addMemberToRoom": "대화 상대 추가",
"addMemberToGroup": "그룹 멤버로 추가",
"copyChatText": "대화 복사",
"removeEvent": "대화 삭제",
"recallEvent": "대화 회수",
"modifyRoomMember": "대화방 멤버 편집",
"ejectFromRoom": "강퇴",
"confirmEjectFromRoom": "{{targetMember}} 님을 대화방에서 퇴장 시키겠습니까?",
"badgeDescriptionForUnread": "확인하지 않은 메시지가 있습니다.",
"albumBox": {
"label": "앨범함"
},
"fileBox": {
"label": "파일함"
},
"errors": {
"label": "대화 에러",
"inputChatMessage": "대화 내용을 입력해 주세요.",
"maxLengthOfMassText": "스티커를 포함할 경우 {{maxLength}}자 이상 보낼 수 없습니다."
},
"detailView": "상세 보기"
},
"organization": {
"chart": "조직도",
"addToGroup": "그룹에 추가",
"startChat": "대화",
"startVideoConference": "화상회의",
"makeExtensionCall": "내선번호 전화걸기",
"makeMobileCall": "모바일 전화걸기",
"sendMessage": "쪽지 보내기",
"sendSMS": "SMS 보내기"
},
"message": {
"label": "쪽지",
"newMessage": "새로운 쪽지",
"sendTo": "쪽지 보내기",
"placeholderForSearch": "이름, 제목, 내용 검색",
"messageTypeAll": "전체",
"messageTypeReceiving": "수신",
"messageTypeOutgoing": "발신",
"messageTypeReservation": "예약",
"searchTypeName": "이름",
"searchTypeTitle": "제목",
"searchTypeContent": "내용",
"badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다."
},
"notice": {
"fieldTitle": "제목",
"fieldPostDate": "게시일"
},
"common": { "common": {
"search": "검색", "search": "검색",
"searchWord": "검색어", "searchWord": "검색어",
@ -10,9 +111,6 @@
"size": "파일 크기", "size": "파일 크기",
"download": "파일 다운로드", "download": "파일 다운로드",
"delete": "파일 삭제", "delete": "파일 삭제",
"saved": "파일이 저장되었습니다.",
"savedToPath": "파일이 경로[{{path}}]에 저장되었습니다.",
"failToSave": "파일 저장에 실패하였습니다.",
"downloadSelected": "선택된 파일 다운로드", "downloadSelected": "선택된 파일 다운로드",
"openDownloadFolder": "다운로드 폴더 열기", "openDownloadFolder": "다운로드 폴더 열기",
"selectFiles": "파일을 선택하세요", "selectFiles": "파일을 선택하세요",
@ -20,6 +118,21 @@
"label": "파일 종류", "label": "파일 종류",
"images": "이미지", "images": "이미지",
"video": "동영상" "video": "동영상"
},
"results": {
"saved": "파일이 저장되었습니다.",
"savedToPath": "파일이 경로[{{path}}]에 저장되었습니다."
},
"errors": {
"label": "파일 에러",
"failToUpload": "파일 업로드에 실패하였습니다.",
"failToSave": "파일 저장에 실패하였습니다.",
"failToSpecifyPath": "저장경로 지정에 실패하였습니다."
}
},
"clipboard": {
"results": {
"copied": "클립보드에 복사되었습니다."
} }
}, },
"messages": { "messages": {
@ -632,83 +745,5 @@
"WET": "WET", "WET": "WET",
"Zulu": "줄루" "Zulu": "줄루"
} }
},
"profile": {
"open": "프로필 보기"
},
"group": {
"label": "그룹",
"addNew": "새 그룹 추가",
"expandMore": "그룹 전체 열기",
"expandLess": "그룹 전체 닫기",
"name": "그룹 이름",
"nameFavorit": "즐겨찾기",
"nameMyDept": "소속부서",
"nameDefault": "기본",
"favorite": "즐겨찾기 등록",
"unfavorite": "즐겨찾기 해제",
"removeBuddyFromGroup": "이 그룹에서 삭제",
"copyBuddyToGroup": "대화 상대 복사",
"moveBuddyToGroup": "대화 상대 이동",
"changeGroupName": "그룹 이름 바꾸기",
"modifyGroupMember": "그룹 멤버 변경",
"removeGroup": "그룹 삭제",
"startChatWithGroup": "그룹 대화하기",
"sendMessageToGroup": "그룹 쪽지 보내기",
"selectTargetGroup": "대상 그룹 선택"
},
"chat": {
"label": "대화",
"room": "대화방",
"searchRoomByName": "대화방 이름 검색",
"newTimerChat": "새로운 타이머 대화",
"newChat": "새로운 대화",
"startChat": "대화하기",
"openRoom": "대화방 열기",
"turnOnRoomAlert": "대화방 알람 켜기",
"turnOffRoomAlert": "대화방 알람 끄기",
"leaveFromRoom": "대화방 나가기",
"confirmLeaveFromRoom": "대화방을 나가시겠습니까?<br/>나가기를 하면 대화내용 및 대화방 정보가 삭제됩니다.",
"confirmDeleteFile": "선택한 파일(메시지)를 삭제하시겠습니까?<br/>삭제된 파일(메시지)는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.",
"typeReceived": "수신",
"typeSent": "발신",
"sentDate": "보낸 날짜",
"validityPeriod": "유효 기간",
"forwardFileToMe": "파일을 나에게 전달",
"forwardFileTo": "파일 전달",
"addMemberToRoom": "대화 상대 추가",
"addMemberToGroup": "그룹 멤버로 추가",
"modifyRoomMember": "대화방 멤버 편집",
"ejectFromRoom": "Eject from room",
"confirmEjectFromRoom": "{{targetMember}} 님을 대화방에서 퇴장 시키겠습니까?",
"badgeDescriptionForUnread": "확인하지 않은 메시지가 있습니다."
},
"organization": {
"chart": "조직도",
"addToGroup": "그룹에 추가",
"startChat": "대화",
"startVideoConference": "화상회의",
"makeExtensionCall": "내선번호 전화걸기",
"makeMobileCall": "모바일 전화걸기",
"sendMessage": "쪽지 보내기",
"sendSMS": "SMS 보내기"
},
"message": {
"label": "쪽지",
"newMessage": "새로운 쪽지",
"sendTo": "쪽지 보내기",
"placeholderForSearch": "이름, 제목, 내용 검색",
"messageTypeAll": "전체",
"messageTypeReceiving": "수신",
"messageTypeOutgoing": "발신",
"messageTypeReservation": "예약",
"searchTypeName": "이름",
"searchTypeTitle": "제목",
"searchTypeContent": "내용",
"badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다."
},
"notice": {
"fieldTitle": "제목",
"fieldPostDate": "게시일"
} }
} }