52 lines
1.8 KiB
JavaScript
52 lines
1.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.t = exports.languageData = exports.CallTips = void 0;
|
|
const index_1 = require("../CallService/index");
|
|
const index_2 = require("../const/index");
|
|
const en_1 = require("./en");
|
|
const zh_cn_1 = require("./zh-cn");
|
|
const ja_JP_1 = require("./ja_JP");
|
|
exports.CallTips = {
|
|
OTHER_SIDE: 'other side',
|
|
CANCEL: 'cancel',
|
|
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',
|
|
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',
|
|
};
|
|
exports.languageData = {
|
|
en: en_1.en,
|
|
'zh-cn': zh_cn_1.zh,
|
|
ja_JP: ja_JP_1.ja_JP,
|
|
};
|
|
// language translate
|
|
function t(key) {
|
|
var _a;
|
|
const language = index_1.TUIStore.getData(index_2.StoreName.CALL, index_2.NAME.LANGUAGE);
|
|
// eslint-disable-next-line
|
|
for (const langKey in exports.languageData) {
|
|
if (langKey === language) {
|
|
const currentLanguage = exports.languageData[langKey];
|
|
// eslint-disable-next-line
|
|
for (const sentenceKey in currentLanguage) {
|
|
if (sentenceKey === key) {
|
|
return currentLanguage[sentenceKey];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const enString = (_a = key['en']) === null || _a === void 0 ? void 0 : _a.key; // eslint-disable-line
|
|
console.error(`${index_2.NAME.PREFIX}translation is not found: ${key}.`);
|
|
return enString;
|
|
}
|
|
exports.t = t;
|