From 4f0964c0b3233464270576a207bdc7dbfa654632 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 28 Nov 2020 21:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E6=B3=A8=E6=89=93?= =?UTF-8?q?=E8=B5=8F=E7=94=A8=E6=88=B7=E5=90=8D=E8=AF=BB=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/chat/ChatClientDirect.js | 4 +- frontend/src/api/chatConfig.js | 3 +- .../src/components/ChatRenderer/ImgShadow.vue | 6 +- .../src/components/ChatRenderer/Ticker.vue | 5 +- .../src/components/ChatRenderer/constants.js | 11 +- .../src/components/ChatRenderer/index.vue | 7 +- frontend/src/lang/en.js | 4 + frontend/src/lang/ja.js | 4 + frontend/src/lang/zh.js | 4 + frontend/src/layout/index.vue | 2 +- frontend/src/main.js | 5 +- frontend/src/{utils.js => utils/index.js} | 0 frontend/src/utils/pronunciation/dictKana.js | 20902 ++++++++++++++++ .../src/utils/pronunciation/dictPinyin.js | 20902 ++++++++++++++++ frontend/src/utils/pronunciation/index.js | 54 + frontend/src/views/Home.vue | 7 + frontend/src/views/Room.vue | 23 +- update.py | 2 + 18 files changed, 41927 insertions(+), 18 deletions(-) rename frontend/src/{utils.js => utils/index.js} (100%) create mode 100644 frontend/src/utils/pronunciation/dictKana.js create mode 100644 frontend/src/utils/pronunciation/dictPinyin.js create mode 100644 frontend/src/utils/pronunciation/index.js diff --git a/frontend/src/api/chat/ChatClientDirect.js b/frontend/src/api/chat/ChatClientDirect.js index d3930af..f83174f 100644 --- a/frontend/src/api/chat/ChatClientDirect.js +++ b/frontend/src/api/chat/ChatClientDirect.js @@ -1,5 +1,5 @@ import axios from 'axios' -import {inflate} from 'pako' +import * as pako from 'pako' import {getUuid4Hex} from '@/utils' import * as avatar from './avatar' @@ -172,7 +172,7 @@ export default class ChatClientDirect { case OP_SEND_MSG_REPLY: { let body = new Uint8Array(data.buffer, offset + HEADER_SIZE, packLen - HEADER_SIZE) if (ver == WS_BODY_PROTOCOL_VERSION_DEFLATE) { - body = inflate(body) + body = pako.inflate(body) this.handlerMessage(body) } else { try { diff --git a/frontend/src/api/chatConfig.js b/frontend/src/api/chatConfig.js index 05ad65a..5afaeae 100644 --- a/frontend/src/api/chatConfig.js +++ b/frontend/src/api/chatConfig.js @@ -18,7 +18,8 @@ export const DEFAULT_CONFIG = { blockMedalLevel: 0, relayMessagesByServer: false, - autoTranslate: false + autoTranslate: false, + giftUsernamePronunciation: '' } export function setLocalConfig (config) { diff --git a/frontend/src/components/ChatRenderer/ImgShadow.vue b/frontend/src/components/ChatRenderer/ImgShadow.vue index f5c1368..22ec060 100644 --- a/frontend/src/components/ChatRenderer/ImgShadow.vue +++ b/frontend/src/components/ChatRenderer/ImgShadow.vue @@ -5,7 +5,7 @@