修复多语言翻译

This commit is contained in:
whyour 2023-08-26 15:29:44 +08:00
parent aa5d6f3cb6
commit b4e4e84bbd
4 changed files with 107 additions and 96 deletions

View File

@ -337,7 +337,7 @@
"飞书机器人": "飞书机器人", "飞书机器人": "飞书机器人",
"自定义通知": "自定义通知", "自定义通知": "自定义通知",
"已关闭": "已关闭", "已关闭": "已关闭",
"gotify的url地址,例如 https://push.example.de:8080": "gotify的url地址,例如 https://push.example.de:8080", "gotify的url地址,例如 https://push.example.de:8080": "gotify的url地址例如 https://push.example.de:8080",
"gotify的消息应用token码": "gotify的消息应用token码", "gotify的消息应用token码": "gotify的消息应用token码",
"推送消息的优先级": "推送消息的优先级", "推送消息的优先级": "推送消息的优先级",
"chat的url地址": "chat的url地址", "chat的url地址": "chat的url地址",
@ -349,21 +349,21 @@
"PushDeer的Keyhttps://github.com/easychen/pushdeer": "PushDeer的Keyhttps://github.com/easychen/pushdeer", "PushDeer的Keyhttps://github.com/easychen/pushdeer": "PushDeer的Keyhttps://github.com/easychen/pushdeer",
"PushDeer的自架API endpoint默认是 https://api2.pushdeer.com/message/push": "PushDeer的自架API endpoint默认是 https://api2.pushdeer.com/message/push", "PushDeer的自架API endpoint默认是 https://api2.pushdeer.com/message/push": "PushDeer的自架API endpoint默认是 https://api2.pushdeer.com/message/push",
"Bark的信息IP/设备码例如https://api.day.app/XXXXXXXX": "Bark的信息IP/设备码例如https://api.day.app/XXXXXXXX", "Bark的信息IP/设备码例如https://api.day.app/XXXXXXXX": "Bark的信息IP/设备码例如https://api.day.app/XXXXXXXX",
"BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)": "BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)", "BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)": "BARK推送图标自定义推送图标 (需iOS15或以上才能显示)",
"BARK推送铃声,铃声列表去APP查看复制填写": "BARK推送铃声,铃声列表去APP查看复制填写", "BARK推送铃声铃声列表去APP查看复制填写": "BARK推送铃声铃声列表去APP查看复制填写",
"BARK推送消息的分组, 默认为qinglong": "BARK推送消息的分组, 默认为qinglong", "BARK推送消息的分组默认为qinglong": "BARK推送消息的分组默认为qinglong",
"telegram机器人的token例如1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw": "telegram机器人的token例如1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw", "telegram机器人的token例如1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw": "telegram机器人的token例如1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw",
"telegram用户的id例如129xxx206": "telegram用户的id例如129xxx206", "telegram用户的id例如129xxx206": "telegram用户的id例如129xxx206",
"代理IP": "代理IP", "代理IP": "代理IP",
"代理端口": "代理端口", "代理端口": "代理端口",
"telegram代理配置认证参数, 用户名与密码用英文冒号连接 user:password": "telegram代理配置认证参数, 用户名与密码用英文冒号连接 user:password", "telegram代理配置认证参数用户名与密码用英文冒号连接 user:password": "telegram代理配置认证参数, 用户名与密码用英文冒号连接 user:password",
"telegram api自建的反向代理地址默认tg官方api": "telegram api自建的反向代理地址默认tg官方api", "telegram api自建的反向代理地址默认tg官方api": "telegram api自建的反向代理地址默认tg官方api",
"钉钉机器人webhook token例如5a544165465465645d0f31dca676e7bd07415asdasd": "钉钉机器人webhook token例如5a544165465465645d0f31dca676e7bd07415asdasd", "钉钉机器人webhook token例如5a544165465465645d0f31dca676e7bd07415asdasd": "钉钉机器人webhook token例如5a544165465465645d0f31dca676e7bd07415asdasd",
"密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串": "密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串", "密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串": "密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串",
"企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770)例如693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa": "企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770)例如693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa", "企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770)例如693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa": "企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770)例如693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa",
"企业微信代理地址": "企业微信代理地址", "企业微信代理地址": "企业微信代理地址",
"corpid,corpsecret,touser(注:多个成员ID使用|隔开),agentid,消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号)例如wwcfrs,B-76WERQ,qinglong,1000001,2COat": "corpid,corpsecret,touser(注:多个成员ID使用|隔开),agentid,消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号)例如wwcfrs,B-76WERQ,qinglong,1000001,2COat", "corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号)例如wwcfrs,B-76WERQ,qinglong,1000001,2COat": "corpid,corpsecret,touser(注:多个成员ID使用|隔开),agentid,消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号)例如wwcfrs,B-76WERQ,qinglong,1000001,2COat",
"密钥key,智能微秘书个人中心获取apikey申请地址https://wechat.aibotk.com/signup?from=ql": "密钥key,智能微秘书个人中心获取apikey申请地址https://wechat.aibotk.com/signup?from=ql", "密钥key智能微秘书个人中心获取apikey申请地址https://wechat.aibotk.com/signup?from=ql": "密钥key,智能微秘书个人中心获取apikey申请地址https://wechat.aibotk.com/signup?from=ql",
"发送的目标,群组或者好友": "发送的目标,群组或者好友", "发送的目标,群组或者好友": "发送的目标,群组或者好友",
"请输入要发送的目标": "请输入要发送的目标", "请输入要发送的目标": "请输入要发送的目标",
"群聊": "群聊", "群聊": "群聊",

View File

@ -33,6 +33,7 @@ import { useOutletContext } from '@umijs/max';
import { SharedContext } from '@/layouts'; import { SharedContext } from '@/layouts';
import './index.less'; import './index.less';
import CodeMirror from '@uiw/react-codemirror'; import CodeMirror from '@uiw/react-codemirror';
import useResizeObserver from '@react-hook/resize-observer';
const { Text } = Typography; const { Text } = Typography;
const isDemoEnv = window.__ENV__DeployEnv === 'demo'; const isDemoEnv = window.__ENV__DeployEnv === 'demo';
@ -117,7 +118,15 @@ const Setting = () => {
const [loginLogData, setLoginLogData] = useState<any[]>([]); const [loginLogData, setLoginLogData] = useState<any[]>([]);
const [systemLogData, setSystemLogData] = useState<string>(''); const [systemLogData, setSystemLogData] = useState<string>('');
const [notificationInfo, setNotificationInfo] = useState<any>(); const [notificationInfo, setNotificationInfo] = useState<any>();
const systemLogRef = useRef<any>(); const containergRef = useRef<HTMLDivElement>(null);
const [height, setHeight] = useState<number>(0);
useResizeObserver(containergRef, (entry) => {
const _height = entry.target.parentElement?.parentElement?.offsetHeight;
if (_height && height !== _height - 66) {
setHeight(_height - 66);
}
});
const getApps = () => { const getApps = () => {
setLoading(true); setLoading(true);
@ -301,90 +310,88 @@ const Setting = () => {
: [] : []
} }
> >
<Tabs <div ref={containergRef}>
defaultActiveKey="security" <Tabs
size="small" defaultActiveKey="security"
tabPosition="top" size="small"
onChange={tabChange} tabPosition="top"
items={[ onChange={tabChange}
...(!isDemoEnv items={[
? [ ...(!isDemoEnv
{ ? [
key: 'security', {
label: intl.get('安全设置'), key: 'security',
children: ( label: intl.get('安全设置'),
<SecuritySettings user={user} userChange={reloadUser} /> children: (
), <SecuritySettings user={user} userChange={reloadUser} />
}, ),
] },
: []), ]
{ : []),
key: 'app', {
label: intl.get('应用设置'), key: 'app',
children: ( label: intl.get('应用设置'),
<Table children: (
columns={columns} <Table
pagination={false} columns={columns}
dataSource={dataSource} pagination={false}
rowKey="id" dataSource={dataSource}
size="middle" rowKey="id"
scroll={{ x: 768 }} size="middle"
loading={loading} scroll={{ x: 768 }}
/> loading={loading}
), />
}, ),
{ },
key: 'notification', {
label: intl.get('通知设置'), key: 'notification',
children: <NotificationSetting data={notificationInfo} />, label: intl.get('通知设置'),
}, children: <NotificationSetting data={notificationInfo} />,
{ },
key: 'syslog', {
label: intl.get('系统日志'), key: 'syslog',
children: ( label: intl.get('系统日志'),
<CodeMirror children: (
ref={systemLogRef} <CodeMirror
maxHeight={`calc(100vh - ${ maxHeight={`${height}px`}
systemLogRef.current?.editor?.getBoundingClientRect()?.top + value={systemLogData}
16 onCreateEditor={(view) => {
}px)`} setTimeout(() => {
value={systemLogData} view.scrollDOM.scrollTo({
onCreateEditor={(view) => { top: view.scrollDOM.scrollHeight,
setTimeout(() => { behavior: 'smooth',
view.scrollDOM.scrollTo({ });
top: view.scrollDOM.scrollHeight, }, 300);
behavior: 'smooth', }}
}); readOnly={true}
}, 300); theme={theme.includes('dark') ? 'dark' : 'light'}
}} />
readOnly={true} ),
theme={theme.includes('dark') ? 'dark' : 'light'} },
/> {
), key: 'login',
}, label: intl.get('登录日志'),
{ children: <LoginLog data={loginLogData} />,
key: 'login', },
label: intl.get('登录日志'), {
children: <LoginLog data={loginLogData} />, key: 'other',
}, label: intl.get('其他设置'),
{ children: (
key: 'other', <Other
label: intl.get('其他设置'), reloadTheme={reloadTheme}
children: ( socketMessage={socketMessage}
<Other systemInfo={systemInfo}
reloadTheme={reloadTheme} />
socketMessage={socketMessage} ),
systemInfo={systemInfo} },
/> {
), key: 'about',
}, label: intl.get('关于'),
{ children: <About systemInfo={systemInfo} />,
key: 'about', },
label: intl.get('关于'), ]}
children: <About systemInfo={systemInfo} />, ></Tabs>
}, </div>
]}
></Tabs>
<AppModal <AppModal
visible={isModalVisible} visible={isModalVisible}
handleCancel={handleCancel} handleCancel={handleCancel}

View File

@ -188,7 +188,7 @@ const SecuritySettings = ({ user, userChange }: any) => {
hasFeedback hasFeedback
style={{ maxWidth: 300 }} style={{ maxWidth: 300 }}
> >
<Input placeholder={intl.get('用户名')} /> <Input autoComplete="username" placeholder={intl.get('用户名')} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={intl.get('密码')} label={intl.get('密码')}
@ -203,7 +203,11 @@ const SecuritySettings = ({ user, userChange }: any) => {
hasFeedback hasFeedback
style={{ maxWidth: 300 }} style={{ maxWidth: 300 }}
> >
<Input type="password" placeholder={intl.get('密码')} /> <Input
type="password"
autoComplete="current-password"
placeholder={intl.get('密码')}
/>
</Form.Item> </Form.Item>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
{intl.get('保存')} {intl.get('保存')}

View File

@ -174,7 +174,7 @@ export default {
}, },
{ {
label: 'barkGroup', label: 'barkGroup',
tip: intl.get('BARK推送消息的分组, 默认为qinglong'), tip: intl.get('BARK推送消息的分组默认为qinglong'),
}, },
], ],
telegramBot: [ telegramBot: [