From ef8bb122dc8373f9d97bb9acc972124d59ed9c4a Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 29 Jul 2021 18:04:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=A1=A5=E5=85=85=E4=BA=86?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/i18n/langs/en-US/translation.json | 30 ++++++++++++++++- shared/i18n/langs/zh-CN/translation.json | 30 ++++++++++++++++- web/src/components/modals/CreateGroup.tsx | 33 ++++++++++--------- .../routes/Main/Content/Group/GroupHeader.tsx | 13 ++------ 4 files changed, 78 insertions(+), 28 deletions(-) diff --git a/shared/i18n/langs/en-US/translation.json b/shared/i18n/langs/en-US/translation.json index d29618e5..d6d8d642 100644 --- a/shared/i18n/langs/en-US/translation.json +++ b/shared/i18n/langs/en-US/translation.json @@ -1,3 +1,31 @@ { - "kc654b275": "Email" + "k10c018fe": "Teamwork", + "k2488f9ee": "Friend Request", + "k3172297b": "This feature is not yet open", + "k34b5e3ab": "Send Message", + "k35abe359": "Lobby", + "k35f990b0": "View Detail", + "k3f3597fc": "All", + "k4d32a754": "Group Name", + "k517db7e5": "Text Channel", + "k51db56bf": "Temporary Meeting", + "k61a1db2": "Already applied", + "k63857abf": "Confirm Create", + "k68283d04": "Application sent", + "k744ee9a": "Create Group", + "k78e52ed0": "Accept", + "k8582af3f": "Refuse", + "k8abdba5c": "Has been sent", + "k9d901c20": "Meeting room", + "ka0451c97": "Cancel", + "ka2c48894": "Customize your group", + "ka5d64ee9": "Choose the following template and start creating your own group!", + "kaa040a8e": "Default Group", + "kc14b2ea3": "Back", + "kc1afdd08": "Don't worry, you can make changes anytime after this", + "kc654b275": "Email", + "kdc18deca": "Invite users", + "kdc4b4f92": "Public", + "kf7d829eb": "Wait to process", + "kfa01c850": "No private message found" } diff --git a/shared/i18n/langs/zh-CN/translation.json b/shared/i18n/langs/zh-CN/translation.json index 4b163635..ea2ace11 100644 --- a/shared/i18n/langs/zh-CN/translation.json +++ b/shared/i18n/langs/zh-CN/translation.json @@ -1,3 +1,31 @@ { - "kc654b275": "邮箱" + "k10c018fe": "工作协同", + "k2488f9ee": "申请好友", + "k3172297b": "该功能暂未开放", + "k34b5e3ab": "发送消息", + "k35abe359": "大厅", + "k35f990b0": "查看详情", + "k3f3597fc": "全员", + "k4d32a754": "群组名称", + "k517db7e5": "文字频道", + "k51db56bf": "临时会议", + "k61a1db2": "已申请", + "k63857abf": "确认创建", + "k68283d04": "已发送申请", + "k744ee9a": "创建群组", + "k78e52ed0": "接受", + "k8582af3f": "拒绝", + "k8abdba5c": "已发送", + "k9d901c20": "会议室", + "ka0451c97": "取消", + "ka2c48894": "自定义你的群组", + "ka5d64ee9": "选择以下模板, 开始创建属于自己的群组吧!", + "kaa040a8e": "默认群组", + "kc14b2ea3": "返回", + "kc1afdd08": "不要担心, 在此之后你可以随时进行变更", + "kc654b275": "邮箱", + "kdc18deca": "邀请用户", + "kdc4b4f92": "公共", + "kf7d829eb": "待处理", + "kfa01c850": "找不到私信会话" } diff --git a/web/src/components/modals/CreateGroup.tsx b/web/src/components/modals/CreateGroup.tsx index e78cb191..91e6c552 100644 --- a/web/src/components/modals/CreateGroup.tsx +++ b/web/src/components/modals/CreateGroup.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useRef, useState } from 'react'; import { createGroup, GroupPanelType, + t, useAppDispatch, useAsyncRequest, } from 'tailchat-shared'; @@ -19,16 +20,16 @@ const panelTemplate: { }[] = [ { key: 'default', - label: '默认群组', + label: t('默认群组'), panels: [ { id: '00', - name: '文字频道', + name: t('文字频道'), type: GroupPanelType.GROUP, }, { id: '01', - name: '大厅', + name: t('大厅'), parentId: '00', type: GroupPanelType.TEXT, }, @@ -36,33 +37,33 @@ const panelTemplate: { }, { key: 'work', - label: '工作协同', + label: t('工作协同'), panels: [ { id: '00', - name: '公共', + name: t('公共'), type: GroupPanelType.GROUP, }, { id: '01', - name: '全员', + name: t('全员'), parentId: '00', type: GroupPanelType.TEXT, }, { id: '10', - name: '临时会议', + name: t('临时会议'), type: GroupPanelType.GROUP, }, { id: '11', - name: '会议室1', + name: t('会议室') + '1', parentId: '10', type: GroupPanelType.TEXT, }, { id: '11', - name: '会议室2', + name: t('会议室') + '2', parentId: '10', type: GroupPanelType.TEXT, }, @@ -98,11 +99,11 @@ export const ModalCreateGroup: React.FC = React.memo(() => {
- 创建群组 + {t('创建群组')} - 选择以下模板, 开始创建属于自己的群组吧! + {t('选择以下模板, 开始创建属于自己的群组吧!')}
@@ -124,11 +125,11 @@ export const ModalCreateGroup: React.FC = React.memo(() => {
- 自定义你的群组 + {t('自定义你的群组')} - 不要担心, 在此之后你可以随时进行变更 + {t('不要担心, 在此之后你可以随时进行变更')}
@@ -137,7 +138,7 @@ export const ModalCreateGroup: React.FC = React.memo(() => {
-
群组名称:
+
{t('群组名称')}:
{ onClick={handleBack} className="text-white font-bold" > - 返回 + {t('返回')}
diff --git a/web/src/routes/Main/Content/Group/GroupHeader.tsx b/web/src/routes/Main/Content/Group/GroupHeader.tsx index d35dfe20..0ea256e5 100644 --- a/web/src/routes/Main/Content/Group/GroupHeader.tsx +++ b/web/src/routes/Main/Content/Group/GroupHeader.tsx @@ -30,16 +30,9 @@ export const GroupHeader: React.FC = React.memo((props) => { console.log('查看详情')}> {t('查看详情')} - {/* {t('查看详情')} */} - {/* {isGroupManager && ( - {t('邀请成员')} - )} - {isGroupManager && ( - {t('创建面板')} - )} - - {currentUserUUID === groupInfo.owner_uuid ? t('解散团') : t('退出团')} - */} + console.log('邀请用户')}> + {t('邀请用户')} + );