mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
feat: i18n support
This commit is contained in:
parent
ee3ed65356
commit
33102c4586
@ -330,14 +330,13 @@
|
|||||||
"cancel": "Cancel"
|
"cancel": "Cancel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"messages": {
|
|
||||||
"update_success": "User information updated successfully!"
|
|
||||||
},
|
|
||||||
"add": {
|
"add": {
|
||||||
"title": "Create New User Account"
|
"title": "Create New User Account"
|
||||||
},
|
},
|
||||||
"messages": {
|
"messages": {
|
||||||
"create_success": "User account created successfully!"
|
"update_success": "User information updated successfully!",
|
||||||
|
"create_success": "User account created successfully!",
|
||||||
|
"operation_success": "Operation completed successfully!"
|
||||||
},
|
},
|
||||||
"search": "Search users...",
|
"search": "Search users...",
|
||||||
"table": {
|
"table": {
|
||||||
@ -379,9 +378,6 @@
|
|||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"promote": "Promote",
|
"promote": "Promote",
|
||||||
"demote": "Demote"
|
"demote": "Demote"
|
||||||
},
|
|
||||||
"messages": {
|
|
||||||
"operation_success": "Operation completed successfully!"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,14 +330,13 @@
|
|||||||
"cancel": "取消"
|
"cancel": "取消"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"messages": {
|
|
||||||
"update_success": "用户信息更新成功!"
|
|
||||||
},
|
|
||||||
"add": {
|
"add": {
|
||||||
"title": "创建新用户账户"
|
"title": "创建新用户账户"
|
||||||
},
|
},
|
||||||
"messages": {
|
"messages": {
|
||||||
"create_success": "用户账户创建成功!"
|
"update_success": "用户信息更新成功!",
|
||||||
|
"create_success": "用户账户创建成功!",
|
||||||
|
"operation_success": "操作成功完成!"
|
||||||
},
|
},
|
||||||
"search": "搜索用户...",
|
"search": "搜索用户...",
|
||||||
"table": {
|
"table": {
|
||||||
@ -379,9 +378,6 @@
|
|||||||
"edit": "编辑",
|
"edit": "编辑",
|
||||||
"promote": "提升",
|
"promote": "提升",
|
||||||
"demote": "降级"
|
"demote": "降级"
|
||||||
},
|
|
||||||
"messages": {
|
|
||||||
"operation_success": "操作成功完成!"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Form, Header, Segment } from 'semantic-ui-react';
|
import { Button, Form, Card } from 'semantic-ui-react';
|
||||||
import { API, showError, showSuccess } from '../../helpers';
|
import { API, showError, showSuccess } from '../../helpers';
|
||||||
|
|
||||||
const AddUser = () => {
|
const AddUser = () => {
|
||||||
@ -30,49 +30,51 @@ const AddUser = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className='dashboard-container'>
|
||||||
<Segment>
|
<Card fluid className='chart-card'>
|
||||||
<Header as='h3'>{t('user.add.title')}</Header>
|
<Card.Content>
|
||||||
<Form autoComplete='off'>
|
<Card.Header className='header'>{t('user.add.title')}</Card.Header>
|
||||||
<Form.Field>
|
<Form autoComplete='off'>
|
||||||
<Form.Input
|
<Form.Field>
|
||||||
label={t('user.edit.username')}
|
<Form.Input
|
||||||
name='username'
|
label={t('user.edit.username')}
|
||||||
placeholder={t('user.edit.username_placeholder')}
|
name='username'
|
||||||
onChange={handleInputChange}
|
placeholder={t('user.edit.username_placeholder')}
|
||||||
value={username}
|
onChange={handleInputChange}
|
||||||
autoComplete='off'
|
value={username}
|
||||||
required
|
autoComplete='off'
|
||||||
/>
|
required
|
||||||
</Form.Field>
|
/>
|
||||||
<Form.Field>
|
</Form.Field>
|
||||||
<Form.Input
|
<Form.Field>
|
||||||
label={t('user.edit.display_name')}
|
<Form.Input
|
||||||
name='display_name'
|
label={t('user.edit.display_name')}
|
||||||
placeholder={t('user.edit.display_name_placeholder')}
|
name='display_name'
|
||||||
onChange={handleInputChange}
|
placeholder={t('user.edit.display_name_placeholder')}
|
||||||
value={display_name}
|
onChange={handleInputChange}
|
||||||
autoComplete='off'
|
value={display_name}
|
||||||
/>
|
autoComplete='off'
|
||||||
</Form.Field>
|
/>
|
||||||
<Form.Field>
|
</Form.Field>
|
||||||
<Form.Input
|
<Form.Field>
|
||||||
label={t('user.edit.password')}
|
<Form.Input
|
||||||
name='password'
|
label={t('user.edit.password')}
|
||||||
type={'password'}
|
name='password'
|
||||||
placeholder={t('user.edit.password_placeholder')}
|
type='password'
|
||||||
onChange={handleInputChange}
|
placeholder={t('user.edit.password_placeholder')}
|
||||||
value={password}
|
onChange={handleInputChange}
|
||||||
autoComplete='off'
|
value={password}
|
||||||
required
|
autoComplete='off'
|
||||||
/>
|
required
|
||||||
</Form.Field>
|
/>
|
||||||
<Button positive type={'submit'} onClick={submit}>
|
</Form.Field>
|
||||||
{t('user.edit.buttons.submit')}
|
<Button positive type='submit' onClick={submit}>
|
||||||
</Button>
|
{t('user.edit.buttons.submit')}
|
||||||
</Form>
|
</Button>
|
||||||
</Segment>
|
</Form>
|
||||||
</>
|
</Card.Content>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user