mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webatrice: i18n login screen (#4584)
* i18n: login container and form * i18n: activate, host, and register forms * i18n: reset password forms * i18n: login dialogs, ICU formatting * i18n: login containers and components Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
baaf261116
commit
f5b973e15c
35 changed files with 424 additions and 99 deletions
7
webclient/src/components/KnownHosts/KnownHosts.i18n.json
Normal file
7
webclient/src/components/KnownHosts/KnownHosts.i18n.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"KnownHosts": {
|
||||
"label": "Host",
|
||||
"add": "Add new host",
|
||||
"toast": "Host successfully {mode, select, created {created} deleted {deleted} other {edited}}."
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Select, MenuItem } from '@material-ui/core';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import FormControl from '@material-ui/core/FormControl';
|
||||
|
|
@ -33,6 +34,7 @@ const KnownHosts = (props) => {
|
|||
const { input: { onChange }, meta, disabled } = props;
|
||||
const { touched, error, warning } = meta;
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [hostsState, setHostsState] = useState({
|
||||
hosts: [],
|
||||
|
|
@ -168,7 +170,7 @@ const KnownHosts = (props) => {
|
|||
</div>
|
||||
) }
|
||||
|
||||
<InputLabel id='KnownHosts-select'>Host</InputLabel>
|
||||
<InputLabel id='KnownHosts-select'>{ t('KnownHosts.label') }</InputLabel>
|
||||
<Select
|
||||
id='KnownHosts-select'
|
||||
labelId='KnownHosts-label'
|
||||
|
|
@ -181,7 +183,7 @@ const KnownHosts = (props) => {
|
|||
disabled={disabled}
|
||||
>
|
||||
<Button value={hostsState.selectedHost} onClick={openAddKnownHostDialog}>
|
||||
<span>Add new host</span>
|
||||
<span>{ t('KnownHosts.add') }</span>
|
||||
<AddIcon fontSize='small' color='primary' />
|
||||
</Button>
|
||||
|
||||
|
|
@ -213,9 +215,9 @@ const KnownHosts = (props) => {
|
|||
onSubmit={handleDialogSubmit}
|
||||
handleClose={closeKnownHostDialog}
|
||||
/>
|
||||
<Toast open={showCreateToast} onClose={() => setShowCreateToast(false)}>Host successfully created.</Toast>
|
||||
<Toast open={showDeleteToast} onClose={() => setShowDeleteToast(false)}>Host successfully deleted.</Toast>
|
||||
<Toast open={showEditToast} onClose={() => setShowEditToast(false)}>Host successfully edited.</Toast>
|
||||
<Toast open={showCreateToast} onClose={() => setShowCreateToast(false)}>{ t('KnownHosts.toast', { mode: 'created' }) }</Toast>
|
||||
<Toast open={showDeleteToast} onClose={() => setShowDeleteToast(false)}>{ t('KnownHosts.toast', { mode: 'deleted' }) }</Toast>
|
||||
<Toast open={showEditToast} onClose={() => setShowEditToast(false)}>{ t('KnownHosts.toast', { mode: 'edited' }) }</Toast>
|
||||
</div>
|
||||
)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue