This commit is contained in:
Your Name
2026-03-11 09:49:47 +08:00
parent 02ae537b4c
commit 38ad60f4bb
290 changed files with 36917 additions and 123 deletions
@@ -0,0 +1,49 @@
import { TUIStore } from '../CallService/index';
import { NAME, StoreName } from '../const/index';
import { zh } from './zh-cn';
import { interpolate, isString, isPlainObject } from '../utils/common-utils';
export const CallTips: any = {
OTHER_SIDE_REJECT_CALL: 'other side reject call',
REJECT_CALL: 'reject call',
OTHER_SIDE_LINE_BUSY: 'other side line busy',
IN_BUSY: 'in busy',
CALL_TIMEOUT: 'call timeout',
END_CALL: 'end call',
TIMEOUT: 'timeout',
KICK_OUT: 'kick out',
CALLER_CALLING_MSG: 'caller calling message',
CALLER_GROUP_CALLING_MSG: 'wait to be called',
CALLEE_CALLING_VIDEO_MSG: 'callee calling video message',
CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message',
NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access',
NO_CAMERA_DEVICE_PERMISSION: 'no camera access',
LOCAL_NETWORK_IS_POOR: 'The network is poor during your current call',
REMOTE_NETWORK_IS_POOR: 'The other user network is poor during the current call',
};
export const languageData: languageDataType = {
'zh-cn': zh,
};
// language translate
export function t(args): string {
const language = 'zh-cn';
let translationContent = '';
if (isString(args)) {
translationContent = languageData?.[language]?.[args] || '';
} else if (isPlainObject(args)) {
const { key, options } = args;
translationContent = languageData?.[language]?.[key] || '';
translationContent = interpolate(translationContent, options);
}
return translationContent;
}
interface languageItemType {
[key: string]: string;
}
interface languageDataType {
[key: string]: languageItemType;
}
@@ -0,0 +1,87 @@
export const zh = {
// // 按钮文案
// 'hangup': '挂断',
// 'reject': '拒绝',
// 'accept': '接受',
// 'camera': '摄像头',
// 'microphone': '麦克风',
// 'speaker': '扬声器',
// 'open camera': '打开摄像头',
// 'close camera': '关闭摄像头',
// 'open microphone': '打开麦克风',
// 'close microphone': '关闭麦克风',
// // 'video-to-audio': '转语音通话',
// 'virtual-background': '模糊背景',
// 通话结果
'other side reject call': '对方已拒绝',
// 'reject call': '{{ userList }} 拒绝通话',
'cancel': '取消通话',
'other side line busy': '对方忙线',
// 'in busy': '{{ userList }} 正在忙',
'call timeout': '呼叫超时',
// 'end call': '{{ userList }} 结束通话',
// 通话提示语
'caller calling message': '等待对方接受邀请',
'callee calling video message': '邀请你视频通话',
'callee calling audio message': '邀请你语音通话',
'no microphone access': '没有麦克风权限',
'no camera access': '没有摄像头权限',
// 'invite member': '邀请成员',
// 'Invited group call': '邀请你加入多人通话',
// 'Those involved': '参与通话的有:',
'waiting': '等待接听...',
'me': '(我)',
// 弹出层文案
// 'browser-authorization': '浏览器授权',
// 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私',
// 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限',
// 'mac-preferences': '打开系统偏好设置',
// 'win-preferences': '打开系统设置',
// 'Please enter userID': '请输入 userID',
// 'View more': '查看更多',
// 'people selected': '人已选中',
// 'Select all': '全选',
'Cancel': '取消',
// 'exist group call': '当前群组中已经存在群组通话',
// // UI3.0 新增
// 'camera enabled': '摄像头已开',
// 'camera disabled': '摄像头已关',
// 'microphone enabled': '麦克风已开',
// 'microphone disabled': '麦克风已关',
// 'speaker enabled': '扬声器已开',
// 'speaker disabled': '扬声器已关',
// 'open speaker': '开启扬声器',
// 'close speaker': '关闭扬声器',
// 'wait to be called': '等待接听',
// 'answered': '已接通',
// 'people in the call': '人参与通话',
// 'failed to obtain speakers': '无法获取扬声器',
// 'you have a new call': '您有一个新的通话',
// 'switch camera': '翻转',
// 'join': '加入',
// 'people on the call': '人正在通话',
// "Supports a maximum of 9 people for simultaneous calls": "最多支持9人同时通话",
'you': '(你)',
"The network is poor during your current call": "当前通话你的网络不佳",
"The other user network is poor during the current call": "当前通话对方网络不佳",
"TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
// // combine chat
// "Video call": "发起视频通话",
// "Voice call": "发起语音通话",
// "Call End": "通话结束",
// "Call duration": "通话时长",
// "Call Cancel": "已取消",
// "Other Side Cancel": "对方已取消",
// "Decline": "已拒绝",
// "Other Side Decline": "对方已拒绝",
// "No answer": "超时无应答",
// "Other Side No Answer": "对方无应答",
// "Answered": "已接听",
// "Other Side Line Busy": "对方忙线中",
// "Line Busy": "忙线无应答",
};