File tree Expand file tree Collapse file tree 6 files changed +62
-11
lines changed
server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src Expand file tree Collapse file tree 6 files changed +62
-11
lines changed Original file line number Diff line number Diff line change 11import { useAsyncFn } from '@capital/common' ;
22import { IconBtn } from '@capital/component' ;
33import React from 'react' ;
4+ import { Translate } from '../translate' ;
45import {
56 useClient ,
67 createMicrophoneAudioTrack ,
@@ -61,7 +62,7 @@ export const Controls: React.FC<{
6162 < div className = "controller" >
6263 < IconBtn
6364 icon = { mediaPerm . video ? 'mdi:video' : 'mdi:video-off' }
64- title = { mediaPerm . video ? '关闭摄像头' : '开启摄像头' }
65+ title = { mediaPerm . video ? Translate . closeCamera : Translate . openCamera }
6566 active = { mediaPerm . video }
6667 disabled = { loading }
6768 size = "large"
@@ -70,7 +71,7 @@ export const Controls: React.FC<{
7071
7172 < IconBtn
7273 icon = { mediaPerm . audio ? 'mdi:microphone' : 'mdi:microphone-off' }
73- title = { mediaPerm . audio ? '关闭麦克风' : '开启麦克风' }
74+ title = { mediaPerm . audio ? Translate . closeMic : Translate . openMic }
7475 active = { mediaPerm . audio }
7576 disabled = { loading }
7677 size = "large"
@@ -79,7 +80,7 @@ export const Controls: React.FC<{
7980
8081 < IconBtn
8182 icon = "mdi:phone-remove-outline"
82- title = "挂断"
83+ title = { Translate . hangUp }
8384 danger = { true }
8485 size = "large"
8586 onClick = { leaveChannel }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { useMeetingStore } from './store';
1111import { NetworkStats } from './NetworkStats' ;
1212import _once from 'lodash/once' ;
1313import type { IAgoraRTCClient } from 'agora-rtc-react' ;
14+ import { Translate } from '../translate' ;
1415
1516const Root = styled . div `
1617 .body {
@@ -113,7 +114,7 @@ export const MeetingView: React.FC<MeetingViewProps> = React.memo((props) => {
113114 < NetworkStats />
114115
115116 < div className = "body" >
116- { start ? < Videos /> : < LoadingSpinner tip = { '正在加入通话...' } /> }
117+ { start ? < Videos /> : < LoadingSpinner tip = { Translate . joinTip } /> }
117118 </ div >
118119
119120 < div className = "controller" >
Original file line number Diff line number Diff line change 11import { showToasts } from '@capital/common' ;
22import { PortalAdd , PortalRemove } from '@capital/component' ;
33import React from 'react' ;
4+ import { Translate } from '../translate' ;
45import { FloatMeetingWindow } from './window' ;
56
67let currentMeeting : string | null = null ;
78
89/**
9- * TODO
10- *
1110 * 启动快速会议
1211 *
1312 * 表现形式是在浏览器内有个小的浮动窗口
1413 */
1514export function startFastMeeting ( meetingId : string ) {
1615 if ( currentMeeting ) {
17- showToasts ( '当前已有正在进行中的通话, 请先结束上一场通话' ) ;
16+ showToasts ( Translate . repeatTip ) ;
1817 return ;
1918 }
2019
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import styled from 'styled-components';
33import { Divider , ErrorBoundary } from '@capital/component' ;
44import { MeetingView , MeetingViewProps } from './MeetingView' ;
55import { SpeakerNames } from './SpeakerNames' ;
6+ import { Translate } from '../translate' ;
67
78const FloatWindow = styled . div `
89 z-index: 100;
@@ -61,7 +62,9 @@ export const FloatMeetingWindow: React.FC<MeetingViewProps> = React.memo(
6162
6263 < Divider type = "vertical" />
6364
64- < span style = { { marginLeft : 4 } } > { folder ? '展开' : '收起' } </ span >
65+ < span style = { { marginLeft : 4 } } >
66+ { folder ? Translate . expand : Translate . foldup }
67+ </ span >
6568 </ div >
6669 </ div >
6770 </ FloatWindow >
Original file line number Diff line number Diff line change 11import { regPluginPanelAction } from '@capital/common' ;
22import { openConfirmModal } from '@capital/component' ;
3+ import { Translate } from './translate' ;
34
45console . log ( 'Plugin 声网音视频 is loaded' ) ;
56
@@ -11,13 +12,13 @@ async function startFastMeeting(meetingId: string) {
1112// 发起群组会议
1213regPluginPanelAction ( {
1314 name : 'plugin:com.msgbyte.meeting/groupAction' ,
14- label : '发起通话' ,
15+ label : Translate . startCall ,
1516 position : 'group' ,
1617 icon : 'mdi:video-box' ,
1718 onClick : ( { groupId, panelId } ) => {
1819 openConfirmModal ( {
19- title : '发起通话' ,
20- content : '是否通过声网插件在当前会话开启音视频通讯?' ,
20+ title : Translate . startCall ,
21+ content : Translate . startCallContent ,
2122 onConfirm : async ( ) => {
2223 startFastMeeting ( `${ groupId } |${ panelId } ` ) ;
2324 } ,
Original file line number Diff line number Diff line change @@ -17,4 +17,50 @@ export const Translate = {
1717 'zh-CN' : '无人发言' ,
1818 'en-US' : 'No one Speaking' ,
1919 } ) ,
20+ startCall : localTrans ( {
21+ 'zh-CN' : '发起通话' ,
22+ 'en-US' : 'Start Call' ,
23+ } ) ,
24+ startCallContent : localTrans ( {
25+ 'zh-CN' : '是否通过声网插件在当前会话开启音视频通讯?' ,
26+ 'en-US' :
27+ 'Do you want to enable audio and video communication in the current session through the Agora plugin?' ,
28+ } ) ,
29+ expand : localTrans ( {
30+ 'zh-CN' : '展开' ,
31+ 'en-US' : 'expand' ,
32+ } ) ,
33+ foldup : localTrans ( {
34+ 'zh-CN' : '收起' ,
35+ 'en-US' : 'foldup' ,
36+ } ) ,
37+ joinTip : localTrans ( {
38+ 'zh-CN' : '正在加入通话...' ,
39+ 'en-US' : 'Joining call...' ,
40+ } ) ,
41+ repeatTip : localTrans ( {
42+ 'zh-CN' : '当前已有正在进行中的通话, 请先结束上一场通话' ,
43+ 'en-US' :
44+ 'There is currently an active call, please end the previous call first' ,
45+ } ) ,
46+ hangUp : localTrans ( {
47+ 'zh-CN' : '挂断' ,
48+ 'en-US' : 'Hang Up' ,
49+ } ) ,
50+ openCamera : localTrans ( {
51+ 'zh-CN' : '开启摄像头' ,
52+ 'en-US' : 'Open Camera' ,
53+ } ) ,
54+ closeCamera : localTrans ( {
55+ 'zh-CN' : '关闭摄像头' ,
56+ 'en-US' : 'Close Camera' ,
57+ } ) ,
58+ openMic : localTrans ( {
59+ 'zh-CN' : '开启麦克风' ,
60+ 'en-US' : 'Open Mic' ,
61+ } ) ,
62+ closeMic : localTrans ( {
63+ 'zh-CN' : '关闭麦克风' ,
64+ 'en-US' : 'Close Mic' ,
65+ } ) ,
2066} ;
You can’t perform that action at this time.
0 commit comments