From 34ed1f7c33126ebaa7e48f77351d575d8e89c386 Mon Sep 17 00:00:00 2001 From: Markusplay Date: Wed, 29 Jan 2025 22:21:46 +0200 Subject: [PATCH] add i18n for alert --- src/components/code-of-honor-alert.tsx | 5 ++++- src/messages/en.json | 1 + src/messages/uk.json | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/code-of-honor-alert.tsx b/src/components/code-of-honor-alert.tsx index 1f834339..59d5a8dc 100644 --- a/src/components/code-of-honor-alert.tsx +++ b/src/components/code-of-honor-alert.tsx @@ -18,8 +18,10 @@ import { } from '@/components/ui/alert-dialog'; import { Link } from '@/i18n/routing'; import { Paragraph } from '@/components/typography/paragraph'; +import { useRouter } from 'next/navigation'; export default function CodeOfHonorAlert() { + const router = useRouter(); const t = useTranslations('private.profile'); const { errorToast } = useServerErrorToast(); @@ -34,6 +36,7 @@ export default function CodeOfHonorAlert() { return; } setUser(res); + router.refresh(); }; return ( @@ -50,7 +53,7 @@ export default function CodeOfHonorAlert() { - На головну + {t('button.go-to-home')} {t('button.agree')} diff --git a/src/messages/en.json b/src/messages/en.json index 7cc80d12..e611bc21 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -235,6 +235,7 @@ "add-new": "Add new", "edit": "Edit", "agree": "Agree", + "go-to-home": "Go to homepage", "logout": "Logout" }, "placeholder": { diff --git a/src/messages/uk.json b/src/messages/uk.json index ccbd0d6c..507f3a6a 100644 --- a/src/messages/uk.json +++ b/src/messages/uk.json @@ -236,6 +236,7 @@ "add-new": "Додати новий", "edit": "Редагувати", "agree": "Погоджуюсь", + "go-to-home": "На головну", "logout": "Вийти" }, "placeholder": {