mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
refactor: Improve i18n for settings 2fa
This commit is contained in:
parent
47053cdb50
commit
67ceddc3f7
@ -14,7 +14,7 @@
|
||||
"success": "You have successfully enabled 2FA!"
|
||||
},
|
||||
"delete": {
|
||||
"label": "Disable 2FA",
|
||||
"title": "Disable 2FA",
|
||||
"steps": {
|
||||
"askType": {
|
||||
"code": "I have my 2FA code",
|
||||
@ -27,7 +27,7 @@
|
||||
"label": "Recovery Code"
|
||||
}
|
||||
},
|
||||
"submit": "Disable 2FA",
|
||||
"continueActionLabel": "Disable 2FA",
|
||||
"success": "You have successfully disabled 2FA!"
|
||||
}
|
||||
}
|
||||
|
@ -89,44 +89,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"SettingsRoute": {
|
||||
"2fa": {
|
||||
"title": "Two-Factor-Authentication",
|
||||
"alreadyEnabled": "You have successfully enabled 2FA!",
|
||||
"setup": {
|
||||
"description": "Enable 2FA to add an extra layer of security to your account. Each time you log in, you will need to enter a code generated from your authenticator app. This makes it harder for an attacker to hack into your account as they would need to have access to your phone.",
|
||||
"setupLabel": "Enable 2FA",
|
||||
"code": {
|
||||
"label": "Code",
|
||||
"description": "Enter the code generated by your authenticator app.",
|
||||
"onlyDigits": "The code can only contain digits."
|
||||
},
|
||||
"submit": "Enable 2FA",
|
||||
"expired": "The verification time for your current Two-Factor-Authentication code has expired. A new code has been generated.",
|
||||
"recoveryCodes": {
|
||||
"title": "Note down your recovery codes",
|
||||
"description": "These codes are used to recover your account if you lose access to your authenticator app. Note them down and store them in a safe place. You will not be able to view them again. Do not store them in your password manager. IF YOU LOSE YOUR RECOVERY CODES, YOU WILL LOSE ACCESS TO YOUR ACCOUNT. WE WILL NOT BE ABLE TO HELP YOU.",
|
||||
"submit": "I have noted down my recovery codes"
|
||||
},
|
||||
"success": "You have successfully enabled 2FA!"
|
||||
},
|
||||
"delete": {
|
||||
"showAction": "Disable 2FA",
|
||||
"askType": {
|
||||
"code": "I have my 2FA code",
|
||||
"recoveryCode": "I have a recovery code"
|
||||
},
|
||||
"askCode": {
|
||||
"label": "Code"
|
||||
},
|
||||
"askRecoveryCode": {
|
||||
"label": "Recovery Code"
|
||||
},
|
||||
"submit": "Disable 2FA",
|
||||
"success": "You have successfully disabled 2FA!"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ReservedAliasesRoute": {
|
||||
"title": "Reserved Aliases",
|
||||
"pageActions": {
|
||||
|
@ -17,7 +17,7 @@ export interface Delete2FAProps {
|
||||
}
|
||||
|
||||
export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
const {t} = useTranslation()
|
||||
const {t} = useTranslation("settings-2fa")
|
||||
const {showSuccess, showError} = useErrorSuccessSnacks()
|
||||
const {mutate} = useMutation<SimpleDetailResponse, AxiosError, Delete2FAData>(delete2FA, {
|
||||
onSuccess: () => {
|
||||
@ -36,7 +36,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
case "showAction":
|
||||
return (
|
||||
<Button onClick={() => setView("askType")} startIcon={<BsShieldLockFill />}>
|
||||
{t("routes.SettingsRoute.2fa.delete.showAction")}
|
||||
{t("delete.title")}
|
||||
</Button>
|
||||
)
|
||||
|
||||
@ -45,7 +45,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
<Grid container spacing={2}>
|
||||
<Grid item>
|
||||
<Button onClick={() => setView("askCode")} startIcon={<BsPhone />}>
|
||||
{t("routes.SettingsRoute.2fa.delete.askType.code")}
|
||||
{t("delete.steps.askType.code")}
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
@ -53,7 +53,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
onClick={() => setView("askRecoveryCode")}
|
||||
startIcon={<MdSettingsBackupRestore />}
|
||||
>
|
||||
{t("routes.SettingsRoute.2fa.delete.askType.recoveryCode")}
|
||||
{t("delete.steps.askType.recoveryCode")}
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@ -65,7 +65,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
<Grid item>
|
||||
<TextField
|
||||
fullWidth
|
||||
label={t("routes.SettingsRoute.2fa.delete.askCode.label")}
|
||||
label={t("delete.steps.askCode.label")}
|
||||
value={value}
|
||||
onChange={e => setValue(e.target.value)}
|
||||
/>
|
||||
@ -76,7 +76,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
variant="contained"
|
||||
startIcon={<BsShieldLockFill />}
|
||||
>
|
||||
{t("routes.SettingsRoute.2fa.delete.submit")}
|
||||
{t("delete.continueActionLabel")}
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@ -88,7 +88,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
<Grid item>
|
||||
<TextField
|
||||
fullWidth
|
||||
label={t("routes.SettingsRoute.2fa.delete.askRecoveryCode.label")}
|
||||
label={t("delete.steps.askRecoveryCode.label")}
|
||||
value={value}
|
||||
onChange={e => setValue(e.target.value)}
|
||||
/>
|
||||
@ -99,7 +99,7 @@ export default function Delete2FA({onSuccess}: Delete2FAProps): ReactElement {
|
||||
variant="contained"
|
||||
startIcon={<BsShieldLockFill />}
|
||||
>
|
||||
{t("routes.SettingsRoute.2fa.delete.submit")}
|
||||
{t("delete.continueActionLabel")}
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
Loading…
x
Reference in New Issue
Block a user