mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-24 13:26:08 +00:00
refactor: switch webchat from sse to websocket (#1808)
* refactor: switch webchat from sse to websocket * perf: image preview dialog * chore: remove console.log
This commit is contained in:
committed by
GitHub
parent
348620ac0a
commit
d09b823c49
@@ -23,8 +23,6 @@ export default function I18nProvider({ children }: I18nProviderProps) {
|
||||
export const extractI18nObject = (i18nObject: I18nObject): string => {
|
||||
// 根据当前语言返回对应的值, fallback优先级:en_US、zh_Hans、zh_Hant、ja_JP
|
||||
const language = i18n.language.replace('-', '_');
|
||||
console.log('language:', language);
|
||||
console.log('i18nObject:', i18nObject);
|
||||
if (language === 'en_US' && i18nObject.en_US) return i18nObject.en_US;
|
||||
if (language === 'zh_Hans' && i18nObject.zh_Hans) return i18nObject.zh_Hans;
|
||||
if (language === 'zh_Hant' && i18nObject.zh_Hant) return i18nObject.zh_Hant;
|
||||
|
||||
@@ -518,6 +518,12 @@ const enUS = {
|
||||
loadPipelinesFailed: 'Failed to load pipelines',
|
||||
atTips: 'Mention the bot',
|
||||
streaming: 'Streaming',
|
||||
connected: 'WebSocket connected',
|
||||
disconnected: 'WebSocket disconnected',
|
||||
connectionError: 'WebSocket connection error',
|
||||
connectionFailed: 'WebSocket connection failed',
|
||||
notConnected: 'WebSocket not connected, please try again later',
|
||||
imageUploadFailed: 'Image upload failed',
|
||||
},
|
||||
},
|
||||
knowledge: {
|
||||
|
||||
@@ -521,6 +521,13 @@ const jaJP = {
|
||||
loadPipelinesFailed: 'パイプラインの読み込みに失敗しました',
|
||||
atTips: 'ボットをメンション',
|
||||
streaming: 'ストリーミング',
|
||||
connected: 'WebSocket接続済み',
|
||||
disconnected: 'WebSocket未接続',
|
||||
connectionError: 'WebSocket接続エラー',
|
||||
connectionFailed: 'WebSocket接続に失敗しました',
|
||||
notConnected:
|
||||
'WebSocketに接続されていません。しばらくしてからやり直してください',
|
||||
imageUploadFailed: '画像のアップロードに失敗しました',
|
||||
},
|
||||
},
|
||||
knowledge: {
|
||||
|
||||
@@ -500,6 +500,12 @@ const zhHans = {
|
||||
loadPipelinesFailed: '加载流水线失败',
|
||||
atTips: '提及机器人',
|
||||
streaming: '流式传输',
|
||||
connected: 'WebSocket已连接',
|
||||
disconnected: 'WebSocket未连接',
|
||||
connectionError: 'WebSocket连接错误',
|
||||
connectionFailed: 'WebSocket连接失败',
|
||||
notConnected: 'WebSocket未连接,请稍后重试',
|
||||
imageUploadFailed: '图片上传失败',
|
||||
},
|
||||
},
|
||||
knowledge: {
|
||||
|
||||
@@ -497,6 +497,13 @@ const zhHant = {
|
||||
loadMessagesFailed: '載入訊息失敗',
|
||||
loadPipelinesFailed: '載入流程線失敗',
|
||||
atTips: '提及機器人',
|
||||
streaming: '串流傳輸',
|
||||
connected: 'WebSocket已連接',
|
||||
disconnected: 'WebSocket未連接',
|
||||
connectionError: 'WebSocket連接錯誤',
|
||||
connectionFailed: 'WebSocket連接失敗',
|
||||
notConnected: 'WebSocket未連接,請稍後重試',
|
||||
imageUploadFailed: '圖片上傳失敗',
|
||||
},
|
||||
},
|
||||
knowledge: {
|
||||
|
||||
Reference in New Issue
Block a user