From 7229078778f3f59fb10daf129d6bb543b95758d3 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sat, 4 Mar 2023 21:52:57 +0100 Subject: [PATCH] refactor: Improve i18n for logout --- public/locales/en-US/logout.json | 4 ++++ public/locales/en-US/translation.json | 23 ----------------------- src/routes/LogoutRoute.tsx | 8 +++----- 3 files changed, 7 insertions(+), 28 deletions(-) create mode 100644 public/locales/en-US/logout.json diff --git a/public/locales/en-US/logout.json b/public/locales/en-US/logout.json new file mode 100644 index 0000000..ce11cd5 --- /dev/null +++ b/public/locales/en-US/logout.json @@ -0,0 +1,4 @@ +{ + "title": "Log out", + "description": "We are logging you out..." +} diff --git a/public/locales/en-US/translation.json b/public/locales/en-US/translation.json index 2c68792..1f9d057 100644 --- a/public/locales/en-US/translation.json +++ b/public/locales/en-US/translation.json @@ -26,29 +26,6 @@ "title": "Overview", "description": "Not much to see here, yet." }, - "VerifyEmailRoute": { - "title": "Verify your email", - "isLoading": "Verifying your email...", - "isCodeInvalid": "Sorry, but this verification code is invalid.", - "errors": { - "code": { - "invalid": "The verification code is invalid." - } - } - }, - "Recover2FARoute": { - "title": "Recover Two-Factor-Authentication", - "description": "We are very sorry if you lost your codes. Please enter a recovery code to continue. Note that this will disable two-factor authentication for your account. You can enable it again in the settings.", - "forms": { - "recoveryCode": { - "label": "Recovery Code" - }, - "submit": "Disable 2FA" - }, - "unauthorized": "Please make sure to log in first and then reset your two-factor authentication on its screen.", - "canLoginNow": "Two-factor authentication has been disabled. You can now log in.", - "loggedIn": "Two-factor authentication has been disabled. You are now logged in." - }, "CompleteAccountRoute": { "forms": { "generateReports": { diff --git a/src/routes/LogoutRoute.tsx b/src/routes/LogoutRoute.tsx index 0d48c58..29021bc 100644 --- a/src/routes/LogoutRoute.tsx +++ b/src/routes/LogoutRoute.tsx @@ -8,7 +8,7 @@ import {useNavigateToNext} from "~/hooks" import {AuthContext} from "~/components" export default function LogoutRoute(): ReactElement { - const {t} = useTranslation() + const {t} = useTranslation("logout") const navigateToNext = useNavigateToNext("/auth/login") const {logout} = useContext(AuthContext) @@ -23,16 +23,14 @@ export default function LogoutRoute(): ReactElement { - {t("routes.LogoutRoute.title")} + {t("title")} - - {t("routes.LogoutRoute.description")} - + {t("description")}