fix: translate error messages and comments to English for consistency

This commit is contained in:
Laisky.Cai
2025-01-27 03:34:27 +00:00
parent 59dba5bef3
commit d5fa98f2e0
25 changed files with 197 additions and 186 deletions

View File

@@ -203,7 +203,7 @@ const ChannelsTable = () => {
trigger={<Label basic color='red'>
Disabled
</Label>}
content='本Channel被手动Disable'
content='This channel has been manually disabled'
basic
/>
);
@@ -213,7 +213,7 @@ const ChannelsTable = () => {
trigger={<Label basic color='yellow'>
Disabled
</Label>}
content='本Channel被程序自动Disable'
content='This channel has been automatically disabled by the program'
basic
/>
);
@@ -277,7 +277,7 @@ const ChannelsTable = () => {
newChannels[realIdx].response_time = time * 1000;
newChannels[realIdx].test_time = Date.now() / 1000;
setChannels(newChannels);
showInfo(`Channel ${name} Test成功Model ${model},耗时 ${time.toFixed(2)}s。`);
showInfo(`Channel ${name} tested successfully with model ${model}, taking ${time.toFixed(2)} seconds.`);
} else {
showError(message);
}
@@ -292,7 +292,7 @@ const ChannelsTable = () => {
const res = await API.get(`/api/channel/test?scope=${scope}`);
const { success, message } = res.data;
if (success) {
showInfo('已成功开始TestChannel请Refresh页面查看结果。');
showInfo('Successfully started testing channels, please refresh the page to see the results.');
} else {
showError(message);
}
@@ -302,7 +302,7 @@ const ChannelsTable = () => {
const res = await API.delete(`/api/channel/disabled`);
const { success, message, data } = res.data;
if (success) {
showSuccess(`已Delete所有DisableChannel,共计 ${data} `);
showSuccess(`Successfully deleted all disabled channels, total ${data} channels`);
await refresh();
} else {
showError(message);
@@ -504,26 +504,26 @@ const ChannelsTable = () => {
idx,
event.target.value
);
}}>
}}>
<input style={{ maxWidth: '60px' }} />
</Input>}
content='Channel priority - higher value means higher priority'
/>
</Table.Cell>
<Table.Cell hidden={!showDetail}>
<Dropdown
placeholder='请选择TestModel'
selection
options={channel.model_options}
defaultValue={channel.test_model}
onChange={(event, data) => {
</Input>}
content='Channel priority - higher value means higher priority'
/>
</Table.Cell>
<Table.Cell hidden={!showDetail}>
<Dropdown
placeholder='Please select TestModel'
selection
options={channel.model_options}
defaultValue={channel.test_model}
onChange={(event, data) => {
switchTestModel(idx, data.value);
}}
/>
</Table.Cell>
<Table.Cell>
<div>
<Button
}}
/>
</Table.Cell>
<Table.Cell>
<div>
<Button
size={'small'}
positive
onClick={() => {
@@ -597,14 +597,14 @@ const ChannelsTable = () => {
Test all channels
</Button>
<Button size='small' loading={loading} onClick={()=>{testChannels("disabled")}}>
TestDisableChannel
Test disabled channels
</Button>
{/*<Button size='small' onClick={updateAllChannelsBalance}*/}
{/* loading={loading || updatingBalance}>Update the balance of enabled channels</Button>*/}
<Popup
trigger={
<Button size='small' loading={loading}>
DeleteDisableChannel
Delete disabled channels
</Button>
}
on='click'
@@ -627,7 +627,7 @@ const ChannelsTable = () => {
}
/>
<Button size='small' onClick={refresh} loading={loading}>Refresh</Button>
<Button size='small' onClick={toggleShowDetail}>{showDetail ? "隐藏Details" : "Details"}</Button>
<Button size='small' onClick={toggleShowDetail}>{showDetail ? "Hide Details" : "Details"}</Button>
</Table.HeaderCell>
</Table.Row>
</Table.Footer>

View File

@@ -247,24 +247,24 @@ const OperationSetting = () => {
</Form.Group>
<Form.Button onClick={() => {
deleteHistoryLogs().then();
}}>Clear History Logs</Form.Button>
<Divider />
<Header as='h3'>
}}>Clear History Logs</Form.Button>
<Divider />
<Header as='h3'>
Monitoring Settings
</Header>
<Form.Group widths={3}>
</Header>
<Form.Group widths={3}>
<Form.Input
label='Longest Response Time'
label='Maximum Response Time'
name='ChannelDisableThreshold'
onChange={handleInputChange}
autoComplete='new-password'
value={inputs.ChannelDisableThreshold}
type='number'
min='0'
placeholder='Unit in secondsWhen all operating channels are testedChannels will be automatically disabled if this time is exceeded'
placeholder='Unit in seconds. When all operating channels are tested, channels will be automatically disabled if this time is exceeded'
/>
<Form.Input
label='Quota reminder threshold'
label='Quota Reminder Threshold'
name='QuotaRemindThreshold'
onChange={handleInputChange}
autoComplete='new-password'
@@ -273,8 +273,8 @@ const OperationSetting = () => {
min='0'
placeholder='Email will be sent to remind users when the quota is below this'
/>
</Form.Group>
<Form.Group inline>
</Form.Group>
<Form.Group inline>
<Form.Checkbox
checked={inputs.AutomaticDisableChannelEnabled === 'true'}
label='Automatically disable the channel when it fails'
@@ -283,12 +283,12 @@ const OperationSetting = () => {
/>
<Form.Checkbox
checked={inputs.AutomaticEnableChannelEnabled === 'true'}
label='成功时自动EnableChannel'
label='Automatically enable the channel when it succeeds'
name='AutomaticEnableChannelEnabled'
onChange={handleInputChange}
/>
</Form.Group>
<Form.Button onClick={() => {
</Form.Group>
<Form.Button onClick={() => {
submitConfig('monitor').then();
}}>Save Monitoring Settings</Form.Button>
<Divider />

View File

@@ -249,7 +249,7 @@ const PersonalSetting = () => {
}
{
status.lark_client_id && (
<Button onClick={()=>{onLarkOAuthClicked(status.lark_client_id)}}>Bind飞书账号</Button>
<Button onClick={()=>{onLarkOAuthClicked(status.lark_client_id)}}>Bind Lark Account</Button>
)
}
<Button

View File

@@ -264,7 +264,7 @@ const SystemSetting = () => {
<Form.Group widths='equal'>
<Form.Input
label='Server Address'
placeholder='For examplehttps://yourdomain.com'
placeholder='For example: https://yourdomain.com'
value={inputs.ServerAddress}
name='ServerAddress'
onChange={handleInputChange}
@@ -290,7 +290,7 @@ const SystemSetting = () => {
size={'tiny'}
style={{ maxWidth: '450px' }}
>
<Modal.Header>警告</Modal.Header>
<Modal.Header>Warning</Modal.Header>
<Modal.Content>
<p>Canceling password login will cause all users (including administrators) who have not bound other login methods to be unable to log in via password, confirm cancel?</p>
</Modal.Content>
@@ -303,7 +303,7 @@ const SystemSetting = () => {
await updateOption('PasswordLoginEnabled', 'false');
}}
>
确定
Confirm
</Button>
</Modal.Actions>
</Modal>
@@ -336,7 +336,7 @@ const SystemSetting = () => {
<Form.Group inline>
<Form.Checkbox
checked={inputs.RegisterEnabled === 'true'}
label='Allow new user registration (if this option is off, new users will not be able to register in any way'
label='Allow new user registration (if this option is off, new users will not be able to register in any way)'
name='RegisterEnabled'
onChange={handleInputChange}
/>
@@ -349,12 +349,12 @@ const SystemSetting = () => {
</Form.Group>
<Divider />
<Header as='h3'>
配置邮箱域名白名单
<Header.Subheader>用以防止恶意Users利用临时邮箱批量Sign up</Header.Subheader>
Configure Email Domain Whitelist
<Header.Subheader>To prevent malicious users from using temporary emails to sign up in bulk</Header.Subheader>
</Header>
<Form.Group widths={3}>
<Form.Checkbox
label='Enable邮箱域名白名单'
label='Enable Email Domain Whitelist'
name='EmailDomainRestrictionEnabled'
onChange={handleInputChange}
checked={inputs.EmailDomainRestrictionEnabled === 'true'}
@@ -362,8 +362,8 @@ const SystemSetting = () => {
</Form.Group>
<Form.Group widths={2}>
<Form.Dropdown
label='允许的邮箱域名'
placeholder='允许的邮箱域名'
label='Allowed Email Domains'
placeholder='Allowed Email Domains'
name='EmailDomainWhitelist'
required
fluid
@@ -375,11 +375,11 @@ const SystemSetting = () => {
options={EmailDomainWhitelist}
/>
<Form.Input
label='添加新的允许的邮箱域名'
label='Add New Allowed Email Domain'
action={
<Button type='button' onClick={() => {
submitNewRestrictedDomain();
}}>填入</Button>
}}>Add</Button>
}
onKeyDown={(e) => {
if (e.key === 'Enter') {
@@ -387,14 +387,14 @@ const SystemSetting = () => {
}
}}
autoComplete='new-password'
placeholder='Enter新的允许的邮箱域名'
placeholder='Enter new allowed email domain'
value={restrictedDomainInput}
onChange={(e, { value }) => {
setRestrictedDomainInput(value);
}}
/>
</Form.Group>
<Form.Button onClick={submitEmailDomainWhitelist}>保存邮箱域名白名单Settings</Form.Button>
<Form.Button onClick={submitEmailDomainWhitelist}>Save Email Domain Whitelist Settings</Form.Button>
<Divider />
<Header as='h3'>
Configure SMTP
@@ -428,7 +428,7 @@ const SystemSetting = () => {
</Form.Group>
<Form.Group widths={3}>
<Form.Input
label='SMTP Sender email'
label='SMTP Sender Email'
name='SMTPFrom'
onChange={handleInputChange}
autoComplete='new-password'
@@ -450,7 +450,7 @@ const SystemSetting = () => {
<Header as='h3'>
Configure GitHub OAuth App
<Header.Subheader>
To support login & registration via GitHub
To support login & registration via GitHub,
<a href='https://github.com/settings/developers' target='_blank'>
Click here
</a>
@@ -459,7 +459,7 @@ const SystemSetting = () => {
</Header>
<Message>
Fill in the Homepage URL <code>{inputs.ServerAddress}</code>
Fill in the Authorization callback URL{' '}
, Fill in the Authorization callback URL{' '}
<code>{`${inputs.ServerAddress}/oauth/github`}</code>
</Message>
<Form.Group widths={3}>
@@ -486,18 +486,18 @@ const SystemSetting = () => {
</Form.Button>
<Divider />
<Header as='h3'>
配置飞书授权Log in
Configure Lark OAuth
<Header.Subheader>
用以支持通过飞书进行Log inSign up
To support login & registration via Lark,
<a href='https://open.feishu.cn/app' target='_blank'>
Click here
</a>
Management你的飞书应用
Manage your Lark App
</Header.Subheader>
</Header>
<Message>
主页链接填 <code>{inputs.ServerAddress}</code>
重定向 URL {' '}
Fill in the Homepage URL <code>{inputs.ServerAddress}</code>
, Fill in the Redirect URL{' '}
<code>{`${inputs.ServerAddress}/oauth/lark`}</code>
</Message>
<Form.Group widths={3}>
@@ -520,13 +520,13 @@ const SystemSetting = () => {
/>
</Form.Group>
<Form.Button onClick={submitLarkOAuth}>
保存飞书 OAuth Settings
Save Lark OAuth Settings
</Form.Button>
<Divider />
<Header as='h3'>
Configure WeChat Server
<Header.Subheader>
To support login & registration via WeChat
To support login & registration via WeChat,
<a
href='https://github.com/songquanpeng/wechat-server'
target='_blank'
@@ -538,9 +538,9 @@ const SystemSetting = () => {
</Header>
<Form.Group widths={3}>
<Form.Input
label='WeChat Server Server Address'
label='WeChat Server Address'
name='WeChatServerAddress'
placeholder='For examplehttps://yourdomain.com'
placeholder='For example: https://yourdomain.com'
onChange={handleInputChange}
autoComplete='new-password'
value={inputs.WeChatServerAddress}
@@ -568,29 +568,29 @@ const SystemSetting = () => {
</Form.Button>
<Divider />
<Header as='h3'>
配置 Message Pusher
Configure Message Pusher
<Header.Subheader>
用以推送报警信息
To push alert messages,
<a
href='https://github.com/songquanpeng/message-pusher'
target='_blank'
>
Click here
</a>
了解 Message Pusher
Learn about Message Pusher
</Header.Subheader>
</Header>
<Form.Group widths={3}>
<Form.Input
label='Message Pusher 推送地址'
label='Message Pusher Address'
name='MessagePusherAddress'
placeholder='For examplehttps://msgpusher.com/push/your_username'
placeholder='For example: https://msgpusher.com/push/your_username'
onChange={handleInputChange}
autoComplete='new-password'
value={inputs.MessagePusherAddress}
/>
<Form.Input
label='Message Pusher 访问凭证'
label='Message Pusher Access Credential'
name='MessagePusherToken'
type='password'
onChange={handleInputChange}
@@ -600,13 +600,13 @@ const SystemSetting = () => {
/>
</Form.Group>
<Form.Button onClick={submitMessagePusher}>
保存 Message Pusher Settings
Save Message Pusher Settings
</Form.Button>
<Divider />
<Header as='h3'>
Configure Turnstile
<Header.Subheader>
To support user verification
To support user verification,
<a href='https://dash.cloudflare.com/' target='_blank'>
Click here
</a>

View File

@@ -422,12 +422,12 @@ const TokensTable = () => {
</Button>
<Button size='small' onClick={refresh} loading={loading}>Refresh</Button>
<Dropdown
placeholder='排序方式'
placeholder='Sort By'
selection
options={[
{ key: '', text: 'Default排序', value: '' },
{ key: 'remain_quota', text: 'Remaining quota排序', value: 'remain_quota' },
{ key: 'used_quota', text: 'Used quota排序', value: 'used_quota' },
{ key: '', text: 'Default Order', value: '' },
{ key: 'remain_quota', text: 'Sort by Remaining Quota', value: 'remain_quota' },
{ key: 'used_quota', text: 'Sort by Used Quota', value: 'used_quota' },
]}
value={orderBy}
onChange={handleOrderByChange}

View File

@@ -330,13 +330,13 @@ const UsersTable = () => {
Add New User
</Button>
<Dropdown
placeholder='排序方式'
placeholder='Sort By'
selection
options={[
{ key: '', text: 'Default排序', value: '' },
{ key: 'quota', text: 'Remaining quota排序', value: 'quota' },
{ key: 'used_quota', text: 'Used quota排序', value: 'used_quota' },
{ key: 'request_count', text: 'Number of Requests排序', value: 'request_count' },
{ key: '', text: 'Default Order', value: '' },
{ key: 'quota', text: 'Sort by Remaining Quota', value: 'quota' },
{ key: 'used_quota', text: 'Sort by Used Quota', value: 'used_quota' },
{ key: 'request_count', text: 'Sort by Number of Requests', value: 'request_count' },
]}
value={orderBy}
onChange={handleOrderByChange}

View File

@@ -138,8 +138,8 @@ const EditToken = () => {
</Form.Field>
<Form.Field>
<Form.Dropdown
label='Model范围'
placeholder={'请选择允许使用的Model留空则不进行限制'}
label='Model Range'
placeholder={'Please select the allowed models, leave blank for no restriction'}
name='models'
fluid
multiple
@@ -156,9 +156,9 @@ const EditToken = () => {
</Form.Field>
<Form.Field>
<Form.Input
label='IP 限制'
label='IP Restriction'
name='subnet'
placeholder={'请Enter允许访问的网段For example192.168.0.0/24请使用英文逗号分隔多个网段'}
placeholder={'Please enter the allowed subnet, e.g., 192.168.0.0/24, use commas to separate multiple subnets'}
onChange={handleInputChange}
value={inputs.subnet}
autoComplete='new-password'
@@ -166,9 +166,9 @@ const EditToken = () => {
</Form.Field>
<Form.Field>
<Form.Input
label='Expiration time'
label='Expiration Time'
name='expired_time'
placeholder={'Please enter the expiration time, the format is yyyy-MM-dd HH:mm:ss, -1 means unlimited'}
placeholder={'Please enter the expiration time, format: yyyy-MM-dd HH:mm:ss, -1 means unlimited'}
onChange={handleInputChange}
value={expired_time}
autoComplete='new-password'
@@ -192,7 +192,7 @@ const EditToken = () => {
setExpiredTime(0, 0, 0, 1);
}}>Expires after one minute</Button>
</div>
<Message>Note that the quota of the token is only used to limit the maximum quota usage of the token itself, and the actual usage is limited by the remaining quota of the account.</Message>
<Message>Note that the token's quota is only used to limit the maximum usage of the token itself, and the actual usage is limited by the remaining quota of the account.</Message>
<Form.Field>
<Form.Input
label={`Quota${renderQuotaWithPrompt(remain_quota)}`}