diff --git a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/Controls.tsx b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/Controls.tsx index 86e826b4..7392efb9 100644 --- a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/Controls.tsx +++ b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/Controls.tsx @@ -1,6 +1,7 @@ import { useAsyncFn } from '@capital/common'; import { IconBtn } from '@capital/component'; import React from 'react'; +import { Translate } from '../translate'; import { useClient, createMicrophoneAudioTrack, @@ -61,7 +62,7 @@ export const Controls: React.FC<{
= React.memo((props) => {
- {start ? : } + {start ? : }
diff --git a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/index.tsx b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/index.tsx index 4ea58bc1..07cf4f5b 100644 --- a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/index.tsx +++ b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/index.tsx @@ -1,20 +1,19 @@ import { showToasts } from '@capital/common'; import { PortalAdd, PortalRemove } from '@capital/component'; import React from 'react'; +import { Translate } from '../translate'; import { FloatMeetingWindow } from './window'; let currentMeeting: string | null = null; /** - * TODO - * * 启动快速会议 * * 表现形式是在浏览器内有个小的浮动窗口 */ export function startFastMeeting(meetingId: string) { if (currentMeeting) { - showToasts('当前已有正在进行中的通话, 请先结束上一场通话'); + showToasts(Translate.repeatTip); return; } diff --git a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/window.tsx b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/window.tsx index 0b043afd..838afe40 100644 --- a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/window.tsx +++ b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/FloatWindow/window.tsx @@ -3,6 +3,7 @@ import styled from 'styled-components'; import { Divider, ErrorBoundary } from '@capital/component'; import { MeetingView, MeetingViewProps } from './MeetingView'; import { SpeakerNames } from './SpeakerNames'; +import { Translate } from '../translate'; const FloatWindow = styled.div` z-index: 100; @@ -61,7 +62,9 @@ export const FloatMeetingWindow: React.FC = React.memo( - {folder ? '展开' : '收起'} + + {folder ? Translate.expand : Translate.foldup} +
diff --git a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/index.tsx b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/index.tsx index b5972e3b..90901878 100644 --- a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/index.tsx +++ b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/index.tsx @@ -1,5 +1,6 @@ import { regPluginPanelAction } from '@capital/common'; import { openConfirmModal } from '@capital/component'; +import { Translate } from './translate'; console.log('Plugin 声网音视频 is loaded'); @@ -11,13 +12,13 @@ async function startFastMeeting(meetingId: string) { // 发起群组会议 regPluginPanelAction({ name: 'plugin:com.msgbyte.meeting/groupAction', - label: '发起通话', + label: Translate.startCall, position: 'group', icon: 'mdi:video-box', onClick: ({ groupId, panelId }) => { openConfirmModal({ - title: '发起通话', - content: '是否通过声网插件在当前会话开启音视频通讯?', + title: Translate.startCall, + content: Translate.startCallContent, onConfirm: async () => { startFastMeeting(`${groupId}|${panelId}`); }, diff --git a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/translate.ts b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/translate.ts index fdbceb2d..3a164b23 100644 --- a/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/translate.ts +++ b/server/plugins/com.msgbyte.agora/web/plugins/com.msgbyte.agora/src/translate.ts @@ -17,4 +17,50 @@ export const Translate = { 'zh-CN': '无人发言', 'en-US': 'No one Speaking', }), + startCall: localTrans({ + 'zh-CN': '发起通话', + 'en-US': 'Start Call', + }), + startCallContent: localTrans({ + 'zh-CN': '是否通过声网插件在当前会话开启音视频通讯?', + 'en-US': + 'Do you want to enable audio and video communication in the current session through the Agora plugin?', + }), + expand: localTrans({ + 'zh-CN': '展开', + 'en-US': 'expand', + }), + foldup: localTrans({ + 'zh-CN': '收起', + 'en-US': 'foldup', + }), + joinTip: localTrans({ + 'zh-CN': '正在加入通话...', + 'en-US': 'Joining call...', + }), + repeatTip: localTrans({ + 'zh-CN': '当前已有正在进行中的通话, 请先结束上一场通话', + 'en-US': + 'There is currently an active call, please end the previous call first', + }), + hangUp: localTrans({ + 'zh-CN': '挂断', + 'en-US': 'Hang Up', + }), + openCamera: localTrans({ + 'zh-CN': '开启摄像头', + 'en-US': 'Open Camera', + }), + closeCamera: localTrans({ + 'zh-CN': '关闭摄像头', + 'en-US': 'Close Camera', + }), + openMic: localTrans({ + 'zh-CN': '开启麦克风', + 'en-US': 'Open Mic', + }), + closeMic: localTrans({ + 'zh-CN': '关闭麦克风', + 'en-US': 'Close Mic', + }), };