i18n is working

This commit is contained in:
Richard Park 2020-01-06 18:05:34 +09:00
parent 1d7cfbb9e5
commit 4293c8b16c
11 changed files with 300 additions and 224 deletions

View File

@ -100,7 +100,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.savedToPath', {
v: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {

View File

@ -32,7 +32,9 @@
class="icon-item" class="icon-item"
[matBadgeHidden]="badgeChatUnReadCount <= 0" [matBadgeHidden]="badgeChatUnReadCount <= 0"
[matBadge]="badgeChatUnReadCount" [matBadge]="badgeChatUnReadCount"
matBadgeDescription="확인하지 않은 메시지가 있습니다." matBadgeDescription="{{
'chat.badgeDescriptionForUnread' | translate
}}"
matBadgeColor="accent" matBadgeColor="accent"
matBadgePosition="above after" matBadgePosition="above after"
matTooltip="Chat" matTooltip="Chat"
@ -93,7 +95,9 @@
class="icon-item" class="icon-item"
[matBadgeHidden]="(badgeMessageUnReadCount$ | async) <= 0" [matBadgeHidden]="(badgeMessageUnReadCount$ | async) <= 0"
[matBadge]="badgeMessageUnReadCount$ | async" [matBadge]="badgeMessageUnReadCount$ | async"
matBadgeDescription="확인하지 않은 메시지가 있습니다." matBadgeDescription="{{
'message.badgeDescriptionForUnread' | translate
}}"
matBadgeColor="accent" matBadgeColor="accent"
matBadgePosition="above after" matBadgePosition="above after"
matTooltip="Message" matTooltip="Message"

View File

@ -36,7 +36,7 @@ import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { MessageType } from '@ucap-webmessenger/api-message'; import { MessageType } from '@ucap-webmessenger/api-message';
import { tap } from 'rxjs/operators'; import { tap, take } from 'rxjs/operators';
import { import {
MessageWriteDialogComponent, MessageWriteDialogComponent,
MessageWriteDialogResult, MessageWriteDialogResult,
@ -49,6 +49,7 @@ import {
} from '@app/types'; } from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component'; import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment'; import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core';
export enum MainMenu { export enum MainMenu {
Group = 'GROUP', Group = 'GROUP',
@ -105,6 +106,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
private store: Store<any>, private store: Store<any>,
private dialogService: DialogService, private dialogService: DialogService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private translateService: TranslateService,
private logger: NGXLogger private logger: NGXLogger
) { ) {
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>( this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
@ -164,7 +166,11 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.logger.debug('-----------------------LeftSideComponent ngOnDestroy'); this.logger.debug('-----------------------LeftSideComponent ngOnDestroy');
} }
async onClickNewChat(type: string = 'NORMAL') { onClickNewChat(type: string = 'NORMAL') {
this.translateService
.get(['chat.newTimerChat', 'chat.newChat'])
.pipe(take(1))
.subscribe(async vs => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
CreateChatDialogComponent, CreateChatDialogComponent,
CreateChatDialogData, CreateChatDialogData,
@ -173,7 +179,8 @@ export class LeftSideComponent implements OnInit, OnDestroy {
width: '600px', width: '600px',
data: { data: {
type: UserSelectDialogType.NewChat, type: UserSelectDialogType.NewChat,
title: type === 'TIMER' ? 'chat.newTimerChat' : 'chat.newChat' title:
type === 'TIMER' ? vs['chat.newTimerChat'] : vs['chat.newChat']
} }
}); });
@ -183,7 +190,9 @@ export class LeftSideComponent implements OnInit, OnDestroy {
result.selectedUserList.map(user => userSeqs.push(user.seq)); result.selectedUserList.map(user => userSeqs.push(user.seq));
if (type === 'NORMAL') { if (type === 'NORMAL') {
this.store.dispatch(ChatStore.openRoom({ userSeqList: userSeqs })); this.store.dispatch(
ChatStore.openRoom({ userSeqList: userSeqs })
);
} else if (type === 'TIMER') { } else if (type === 'TIMER') {
this.store.dispatch( this.store.dispatch(
ChatStore.openRoom({ userSeqList: userSeqs, isTimeRoom: true }) ChatStore.openRoom({ userSeqList: userSeqs, isTimeRoom: true })
@ -191,9 +200,14 @@ export class LeftSideComponent implements OnInit, OnDestroy {
} }
} }
} }
});
} }
async onClickNewGroupAndMember() { onClickNewGroupAndMember() {
this.translateService
.get(['group.addNew'])
.pipe(take(1))
.subscribe(async vs => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
CreateChatDialogComponent, CreateChatDialogComponent,
CreateChatDialogData, CreateChatDialogData,
@ -202,7 +216,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
width: '600px', width: '600px',
data: { data: {
type: UserSelectDialogType.NewGroup, type: UserSelectDialogType.NewGroup,
title: 'group.addNew' title: vs['group.addNew']
} }
}); });
@ -223,6 +237,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
); );
} }
} }
});
} }
async onClickNewMessage() { async onClickNewMessage() {
@ -289,7 +304,17 @@ export class LeftSideComponent implements OnInit, OnDestroy {
} }
}); });
} }
setFabInitial(type: string) { setFabInitial(type: string) {
this.translateService
.get([
'group.addNew',
'chat.newChat',
'chat.newTimerChat',
'message.newMessage'
])
.pipe(take(1))
.subscribe(async vs => {
switch (type) { switch (type) {
case MainMenu.Group: case MainMenu.Group:
{ {
@ -297,7 +322,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.fabButtons = [ this.fabButtons = [
{ {
icon: 'add', icon: 'add',
tooltip: 'New Group Add', tooltip: vs['group.addNew'],
divisionType: 'GROUP_NEW_ADD' divisionType: 'GROUP_NEW_ADD'
} }
]; ];
@ -309,7 +334,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.fabButtons = [ this.fabButtons = [
{ {
icon: 'chat', icon: 'chat',
tooltip: 'New Chat', tooltip: vs['chat.newChat'],
divisionType: 'CAHT_NEW_ADD' divisionType: 'CAHT_NEW_ADD'
} }
]; ];
@ -317,7 +342,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
if (environment.productConfig.CommonSetting.useTimerRoom) { if (environment.productConfig.CommonSetting.useTimerRoom) {
this.fabButtons.push({ this.fabButtons.push({
icon: 'timer', icon: 'timer',
tooltip: 'New Timer Chat', tooltip: vs['chat.newTimerChat'],
divisionType: 'CHAT_NEW_TIMER_ADD' divisionType: 'CHAT_NEW_TIMER_ADD'
}); });
} }
@ -334,7 +359,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.fabButtons = [ this.fabButtons = [
{ {
icon: 'add', icon: 'add',
tooltip: 'New Message', tooltip: vs['message.newMessage'],
divisionType: 'MESSAGE_NEW' divisionType: 'MESSAGE_NEW'
} }
]; ];
@ -350,6 +375,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.fabButtonShow = false; this.fabButtonShow = false;
} }
} }
});
} }
onCheckAllUser(params: { onCheckAllUser(params: {

View File

@ -234,7 +234,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.savedToPath', {
v: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {

View File

@ -278,7 +278,7 @@ export class FileBoxComponent implements OnInit, OnDestroy {
if (!!result) { if (!!result) {
this.translateService this.translateService
.get('common.file.savedToPath', { .get('common.file.savedToPath', {
v: result path: result
}) })
.pipe(take(1)) .pipe(take(1))
.subscribe(v => { .subscribe(v => {

View File

@ -12,7 +12,7 @@
<table mat-table [dataSource]="noticelist"> <table mat-table [dataSource]="noticelist">
<ng-container matColumnDef="title"> <ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef class="infos"> <th mat-header-cell *matHeaderCellDef class="infos">
제목 {{ 'notice.fieldTitle' | translate }}
</th> </th>
<td mat-cell *matCellDef="let element" class="notice-info"> <td mat-cell *matCellDef="let element" class="notice-info">
<div class="title"> <div class="title">
@ -23,7 +23,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="regDate"> <ng-container matColumnDef="regDate">
<th mat-header-cell *matHeaderCellDef> <th mat-header-cell *matHeaderCellDef>
게시일 {{ 'notice.fieldPostDate' | translate }}
</th> </th>
<td mat-cell *matCellDef="let element" class="date"> <td mat-cell *matCellDef="let element" class="date">
<div class="date"> <div class="date">

View File

@ -17,10 +17,10 @@
class="btn-box" class="btn-box"
> >
<button mat-flat-button class="mat-primary" (click)="onClickAddMember()"> <button mat-flat-button class="mat-primary" (click)="onClickAddMember()">
대화상대추가 {{ 'chat.addMemberToRoom' | translate }}
</button> </button>
<button mat-flat-button class="mat-primary" (click)="onClickAddGroup()"> <button mat-flat-button class="mat-primary" (click)="onClickAddGroup()">
그룹멤버로추가 {{ 'chat.addMemberToGroup' | translate }}
</button> </button>
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
> >
<ng-template matMenuContent let-buddy="buddy"> <ng-template matMenuContent let-buddy="buddy">
<button mat-menu-item (click)="onClickContextMenu('FORCING_EXIT', buddy)"> <button mat-menu-item (click)="onClickContextMenu('FORCING_EXIT', buddy)">
대화방 퇴장 {{ 'chat.ejectFromRoom' | translate }}
</button> </button>
</ng-template> </ng-template>
</mat-menu> </mat-menu>

View File

@ -8,7 +8,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { tap, map } from 'rxjs/operators'; import { tap, map, take } from 'rxjs/operators';
import * as AppStore from '@app/store'; import * as AppStore from '@app/store';
import * as SyncStore from '@app/store/messenger/sync'; import * as SyncStore from '@app/store/messenger/sync';
@ -41,6 +41,7 @@ import {
} from '@app/types'; } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { MatMenuTrigger, MatDialog } from '@angular/material'; import { MatMenuTrigger, MatDialog } from '@angular/material';
import { TranslateService } from '@ngx-translate/core';
@Component({ @Component({
selector: 'app-layout-chat-right-drawer-room-user-list', selector: 'app-layout-chat-right-drawer-room-user-list',
@ -67,6 +68,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
constructor( constructor(
private store: Store<any>, private store: Store<any>,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private translateService: TranslateService,
private dialogService: DialogService, private dialogService: DialogService,
private dialogRef: MatDialog private dialogRef: MatDialog
) { ) {
@ -135,7 +137,11 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
this.openProfile.emit(userSeq); this.openProfile.emit(userSeq);
} }
async onClickAddMember() { onClickAddMember() {
this.translateService
.get('chat.modifyRoomMember')
.pipe(take(1))
.subscribe(async v => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
CreateChatDialogComponent, CreateChatDialogComponent,
CreateChatDialogData, CreateChatDialogData,
@ -144,7 +150,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
width: '600px', width: '600px',
data: { data: {
type: UserSelectDialogType.EditChatMember, type: UserSelectDialogType.EditChatMember,
title: 'Edit Chat Member', title: v,
curRoomUser: this.userInfoList.filter( curRoomUser: this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
) )
@ -179,9 +185,14 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
); );
} }
} }
});
} }
async onClickAddGroup() { onClickAddGroup() {
this.translateService
.get('group.selectTargetGroup')
.pipe(take(1))
.subscribe(async v => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
SelectGroupDialogComponent, SelectGroupDialogComponent,
SelectGroupDialogData, SelectGroupDialogData,
@ -189,7 +200,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
>(SelectGroupDialogComponent, { >(SelectGroupDialogComponent, {
width: '600px', width: '600px',
data: { data: {
title: 'Group Select' title: v
} }
}); });
@ -212,6 +223,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
); );
} }
} }
});
} }
onContextMenuRoomUser(event: MouseEvent, buddy: UserInfo) { onContextMenuRoomUser(event: MouseEvent, buddy: UserInfo) {
@ -229,18 +241,24 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
this.roomUserContextMenuTrigger.openMenu(); this.roomUserContextMenuTrigger.openMenu();
} }
async onClickContextMenu(type: string, buddy: UserInfo) { onClickContextMenu(type: string, buddy: UserInfo) {
switch (type) { switch (type) {
case 'FORCING_EXIT': case 'FORCING_EXIT':
{ {
this.translateService
.get(['chat.ejectFromRoom', 'chat.confirmEjectFromRoom'], {
targetMember: buddy.name
})
.pipe(take(1))
.subscribe(async vs => {
const result = await this.dialogService.open< const result = await this.dialogService.open<
ConfirmDialogComponent, ConfirmDialogComponent,
ConfirmDialogData, ConfirmDialogData,
ConfirmDialogResult ConfirmDialogResult
>(ConfirmDialogComponent, { >(ConfirmDialogComponent, {
data: { data: {
title: '강제 퇴장', title: vs['chat.ejectFromRoom'],
html: `${buddy.name} 님을 대화방에서 퇴장 시키겠습니까?` html: vs['chat.confirmEjectFromRoom']
} }
}); });
@ -256,6 +274,7 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
}) })
); );
} }
});
} }
break; break;
} }

View File

@ -1,13 +1,14 @@
<mat-card class="confirm-card mat-elevation-z"> <mat-card class="confirm-card mat-elevation-z">
<mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle> <mat-card-header cdkDrag cdkDragRootElement=".cdk-overlay-pane" cdkDragHandle>
<mat-card-title>{{ data.title | translate }}</mat-card-title> <mat-card-title>{{ data.title }}</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<div *ngIf="data.type === UserSelectDialogType.NewGroup"> <div *ngIf="data.type === UserSelectDialogType.NewGroup">
<form name="inputForm" [formGroup]="inputForm" novalidate> <form name="inputForm" [formGroup]="inputForm" novalidate>
<mat-form-field <mat-form-field
hintLabel="{{ hintLabel="{{
'common.useOnlyForSpecialCharacter' | translate: { v: '-,_' } 'common.useOnlyForSpecialCharacter'
| translate: { specialCharacter: '-,_' }
}}" }}"
style="display:block;margin-bottom:10px;" style="display:block;margin-bottom:10px;"
> >

View File

@ -654,7 +654,8 @@
"modifyGroupMember": "Modify member of group", "modifyGroupMember": "Modify member of group",
"removeGroup": "Remove group", "removeGroup": "Remove group",
"startChatWithGroup": "Chat with group", "startChatWithGroup": "Chat with group",
"sendMessageToGroup": "Send message to group" "sendMessageToGroup": "Send message to group",
"selectTargetGroup": "Select target group"
}, },
"chat": { "chat": {
"label": "Chat", "label": "Chat",
@ -674,7 +675,13 @@
"sentDate": "Sent date", "sentDate": "Sent date",
"validityPeriod": "Validity period", "validityPeriod": "Validity period",
"forwardFileToMe": "Forward file to me", "forwardFileToMe": "Forward file to me",
"forwardFileTo": "Forward file to ..." "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": { "organization": {
"chart": "Organization chart", "chart": "Organization chart",
@ -688,6 +695,7 @@
}, },
"message": { "message": {
"label": "Message", "label": "Message",
"newMessage": "New message",
"sendTo": "Send message", "sendTo": "Send message",
"placeholderForSearch": "search for name, title, content", "placeholderForSearch": "search for name, title, content",
"messageTypeAll": "All", "messageTypeAll": "All",
@ -696,6 +704,11 @@
"messageTypeReservation": "Reservation", "messageTypeReservation": "Reservation",
"searchTypeName": "Name", "searchTypeName": "Name",
"searchTypeTitle": "Title", "searchTypeTitle": "Title",
"searchTypeContent": "Content" "searchTypeContent": "Content",
"badgeDescriptionForUnread": "There is an unconfirmed message."
},
"notice": {
"fieldTitle": "Title",
"fieldPostDate": "Post date"
} }
} }

View File

@ -3,7 +3,7 @@
"search": "검색", "search": "검색",
"searchWord": "검색어", "searchWord": "검색어",
"searchResult": "검색 결과", "searchResult": "검색 결과",
"useOnlyForSpecialCharacter": "특수문자는 {{v}}만 사용할 수 있습니다.", "useOnlyForSpecialCharacter": "특수문자는 {{specialCharacter}}만 사용할 수 있습니다.",
"howManyPersons": "명", "howManyPersons": "명",
"file": { "file": {
"name": "파일 이름", "name": "파일 이름",
@ -11,7 +11,7 @@
"download": "파일 다운로드", "download": "파일 다운로드",
"delete": "파일 삭제", "delete": "파일 삭제",
"saved": "파일이 저장되었습니다.", "saved": "파일이 저장되었습니다.",
"savedToPath": "파일이 경로[{{v}}]에 저장되었습니다.", "savedToPath": "파일이 경로[{{path}}]에 저장되었습니다.",
"failToSave": "파일 저장에 실패하였습니다.", "failToSave": "파일 저장에 실패하였습니다.",
"downloadSelected": "선택된 파일 다운로드", "downloadSelected": "선택된 파일 다운로드",
"openDownloadFolder": "다운로드 폴더 열기", "openDownloadFolder": "다운로드 폴더 열기",
@ -654,7 +654,8 @@
"modifyGroupMember": "그룹 멤버 변경", "modifyGroupMember": "그룹 멤버 변경",
"removeGroup": "그룹 삭제", "removeGroup": "그룹 삭제",
"startChatWithGroup": "그룹 대화하기", "startChatWithGroup": "그룹 대화하기",
"sendMessageToGroup": "그룹 쪽지 보내기" "sendMessageToGroup": "그룹 쪽지 보내기",
"selectTargetGroup": "대상 그룹 선택"
}, },
"chat": { "chat": {
"label": "대화", "label": "대화",
@ -674,7 +675,13 @@
"sentDate": "보낸 날짜", "sentDate": "보낸 날짜",
"validityPeriod": "유효 기간", "validityPeriod": "유효 기간",
"forwardFileToMe": "파일을 나에게 전달", "forwardFileToMe": "파일을 나에게 전달",
"forwardFileTo": "파일 전달" "forwardFileTo": "파일 전달",
"addMemberToRoom": "대화 상대 추가",
"addMemberToGroup": "그룹 멤버로 추가",
"modifyRoomMember": "대화방 멤버 편집",
"ejectFromRoom": "Eject from room",
"confirmEjectFromRoom": "{{targetMember}} 님을 대화방에서 퇴장 시키겠습니까?",
"badgeDescriptionForUnread": "확인하지 않은 메시지가 있습니다."
}, },
"organization": { "organization": {
"chart": "조직도", "chart": "조직도",
@ -688,6 +695,7 @@
}, },
"message": { "message": {
"label": "쪽지", "label": "쪽지",
"newMessage": "새로운 쪽지",
"sendTo": "쪽지 보내기", "sendTo": "쪽지 보내기",
"placeholderForSearch": "이름, 제목, 내용 검색", "placeholderForSearch": "이름, 제목, 내용 검색",
"messageTypeAll": "전체", "messageTypeAll": "전체",
@ -696,6 +704,11 @@
"messageTypeReservation": "예약", "messageTypeReservation": "예약",
"searchTypeName": "이름", "searchTypeName": "이름",
"searchTypeTitle": "제목", "searchTypeTitle": "제목",
"searchTypeContent": "내용" "searchTypeContent": "내용",
"badgeDescriptionForUnread": "확인하지 않은 쪽지가 있습니다."
},
"notice": {
"fieldTitle": "제목",
"fieldPostDate": "게시일"
} }
} }