Skip to content

Commit

Permalink
add i18n for alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Markusplay committed Jan 29, 2025
1 parent 1d9184b commit 34ed1f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/code-of-honor-alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -34,6 +36,7 @@ export default function CodeOfHonorAlert() {
return;
}
setUser(res);
router.refresh();
};

return (
Expand All @@ -50,7 +53,7 @@ export default function CodeOfHonorAlert() {
</AlertDialogHeader>
<AlertDialogFooter>
<Link href="/">
<AlertDialogCancel>На головну</AlertDialogCancel>
<AlertDialogCancel>{t('button.go-to-home')}</AlertDialogCancel>
</Link>
<AlertDialogAction onClick={handleAcceptCodeOfHonor}>{t('button.agree')}</AlertDialogAction>
</AlertDialogFooter>
Expand Down
1 change: 1 addition & 0 deletions src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"add-new": "Add new",
"edit": "Edit",
"agree": "Agree",
"go-to-home": "Go to homepage",
"logout": "Logout"
},
"placeholder": {
Expand Down
1 change: 1 addition & 0 deletions src/messages/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
"add-new": "Додати новий",
"edit": "Редагувати",
"agree": "Погоджуюсь",
"go-to-home": "На головну",
"logout": "Вийти"
},
"placeholder": {
Expand Down

0 comments on commit 34ed1f7

Please sign in to comment.