mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
add fr and nl translations (#4587)
* add fr and nl translations * update fr * fix password label translation * translate country strings * fix double accents * fix Ivory Coast * sort countries * use more performant Collator over localeCompare Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
f5b973e15c
commit
21f7dd5eba
13 changed files with 555 additions and 279 deletions
|
|
@ -19,10 +19,9 @@ const LoginForm = ({ onSubmit, disableSubmitButton, onResetPassword }: LoginForm
|
|||
const STORED_PASSWORD_LABEL = `* ${t('LoginForm.label.savedPassword')} *`;
|
||||
|
||||
const [host, setHost] = useState(null);
|
||||
const [passwordLabel, setPasswordLabel] = useState(PASSWORD_LABEL);
|
||||
const [useStoredPasswordLabel, setUseStoredPasswordLabel] = useState(false);
|
||||
const [autoConnect, setAutoConnect] = useAutoConnect();
|
||||
|
||||
|
||||
const validate = values => {
|
||||
const errors: any = {};
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ const LoginForm = ({ onSubmit, disableSubmitButton, onResetPassword }: LoginForm
|
|||
|
||||
const useStoredPassword = (remember, password) => remember && host.hashedPassword && !password;
|
||||
const togglePasswordLabel = (useStoredLabel) => {
|
||||
setPasswordLabel(useStoredLabel ? STORED_PASSWORD_LABEL : PASSWORD_LABEL);
|
||||
setUseStoredPasswordLabel(useStoredLabel);
|
||||
};
|
||||
|
||||
const handleOnSubmit = ({ userName, ...values }) => {
|
||||
|
|
@ -120,8 +119,8 @@ const LoginForm = ({ onSubmit, disableSubmitButton, onResetPassword }: LoginForm
|
|||
</div>
|
||||
<div className='loginForm-item'>
|
||||
<Field
|
||||
label={passwordLabel}
|
||||
onFocus={() => setPasswordLabel(PASSWORD_LABEL)}
|
||||
label={useStoredPasswordLabel ? STORED_PASSWORD_LABEL : PASSWORD_LABEL}
|
||||
onFocus={() => setUseStoredPasswordLabel(false)}
|
||||
onBlur={() => togglePasswordLabel(useStoredPassword(values.remember, values.password))}
|
||||
name='password'
|
||||
type='password'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue