style: add translate for integration

pull/90/head
moonrailgun 2 years ago
parent c370347cf4
commit 454522fed8

@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import React, { useState } from 'react';
import { Avatar, Button, Input, UserName } from '@capital/component';
import styled from 'styled-components';
import type { OpenAppInfo } from 'types';
@ -9,6 +9,7 @@ import {
useGroupIdContext,
showSuccessToasts,
} from '@capital/common';
import { Translate } from './translate';
const Tip = styled.div`
color: #999;
@ -51,7 +52,7 @@ const IntegrationPanel: React.FC = React.memo(() => {
});
if (!data) {
showErrorToasts('没找到该应用');
showErrorToasts(Translate.notFoundApp);
return;
}
@ -69,11 +70,11 @@ const IntegrationPanel: React.FC = React.memo(() => {
return (
<div>
<Tip>ID</Tip>
<Tip>{Translate.onlyAllowManualAddition}</Tip>
<Row>
<Input
placeholder={'应用ID'}
placeholder={Translate.appId}
value={appId}
onChange={(e) => setAppId(e.target.value)}
/>
@ -83,7 +84,7 @@ const IntegrationPanel: React.FC = React.memo(() => {
loading={loading}
onClick={handleQueryApp}
>
{Translate.search}
</Button>
</Row>
@ -101,7 +102,7 @@ const IntegrationPanel: React.FC = React.memo(() => {
<div>{openAppInfo.appName}</div>
<div>{openAppInfo.appDesc}</div>
<Row>
<div>:</div>
<div>{Translate.developer}:</div>
<UserName userId={openAppInfo.owner} />
</Row>
@ -113,7 +114,7 @@ const IntegrationPanel: React.FC = React.memo(() => {
loading={addBotLoading}
onClick={handleAddBotIntoGroup}
>
{Translate.addBot}
</Button>
)}
</div>

@ -5,4 +5,28 @@ export const Translate = {
'zh-CN': '集成',
'en-US': 'Integration',
}),
notFoundApp: localTrans({
'zh-CN': '没找到该应用',
'en-US': 'Not found application',
}),
onlyAllowManualAddition: localTrans({
'zh-CN': '目前仅支持通过应用ID手动添加',
'en-US': 'Currently only supports manual addition via app ID',
}),
appId: localTrans({
'zh-CN': '应用ID',
'en-US': 'Application ID',
}),
search: localTrans({
'zh-CN': '查询',
'en-US': 'Search',
}),
developer: localTrans({
'zh-CN': '开发者',
'en-US': 'Developer',
}),
addBot: localTrans({
'zh-CN': '添加应用机器人到群组',
'en-US': 'Add app bot to group',
}),
};

Loading…
Cancel
Save