diff --git a/public/locales/en-US/common.json b/public/locales/en-US/common.json
index c80c4b9..2aa8ffc 100644
--- a/public/locales/en-US/common.json
+++ b/public/locales/en-US/common.json
@@ -9,7 +9,10 @@
},
"2faCode": {
"label": "Code",
- "placeholder": "123456"
+ "placeholder": "123456",
+ "errors": {
+ "shouldOnlyBeDigits": "The code should only contain digits."
+ }
},
"recoveryCode": {
"label": "Recovery Code"
diff --git a/public/locales/en-US/settings-2fa.json b/public/locales/en-US/settings-2fa.json
new file mode 100644
index 0000000..1c2333e
--- /dev/null
+++ b/public/locales/en-US/settings-2fa.json
@@ -0,0 +1,33 @@
+{
+ "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",
+ "continueActionLabel": "Enable 2FA",
+ "codeExpired": "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.",
+ "continueActionLabel": "I have noted down my recovery codes"
+ },
+ "success": "You have successfully enabled 2FA!"
+ },
+ "delete": {
+ "label": "Disable 2FA",
+ "steps": {
+ "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!"
+ }
+}
diff --git a/public/locales/en-US/translation.json b/public/locales/en-US/translation.json
index d148f42..2b285be 100644
--- a/public/locales/en-US/translation.json
+++ b/public/locales/en-US/translation.json
@@ -90,10 +90,6 @@
}
},
"SettingsRoute": {
- "forms": {
- "aliasPreferences": {
- }
- },
"2fa": {
"title": "Two-Factor-Authentication",
"alreadyEnabled": "You have successfully enabled 2FA!",
diff --git a/src/route-widgets/Settings2FARoute/Setup2FA.tsx b/src/route-widgets/Settings2FARoute/Setup2FA.tsx
index 327e772..2b9a311 100644
--- a/src/route-widgets/Settings2FARoute/Setup2FA.tsx
+++ b/src/route-widgets/Settings2FARoute/Setup2FA.tsx
@@ -18,7 +18,7 @@ export interface Setup2FAProps {
}
export default function Setup2FA({onSuccess}: Setup2FAProps): ReactElement {
- const {t} = useTranslation()
+ const {t} = useTranslation("settings-2fa")
const {showError} = useErrorSuccessSnacks()
const {
@@ -33,9 +33,7 @@ export default function Setup2FA({onSuccess}: Setup2FAProps): ReactElement {
return (