Skip to content

Commit c678144

Browse files
committed
added translations for not-found component
1 parent 5faa0aa commit c678144

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

public/locales/de/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
"searchPlaceholder": "tippen, um todos zu suchen ...",
2121
"createNewTodo": "Neues Todo erstellen",
2222
"noTodosFound": "Es gibt keine Todos",
23-
"goBackHome": "Zur Startseite"
23+
"goBackHome": "Zur Startseite",
24+
"pageNotFoundTitle": "Seite nicht gefunden",
25+
"pageNotFoundSubtitle": "Leider konnten wir die von Ihnen gesuchte Seite nicht finden."
2426
}

public/locales/en/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
"searchPlaceholder": "type to search todos ...",
2121
"createNewTodo": "Create new todo",
2222
"noTodosFound": "There are no todos",
23-
"goBackHome": "Go Home"
23+
"goBackHome": "Go Home",
24+
"pageNotFoundTitle": "Page Not Found",
25+
"pageNotFoundSubtitle": "Sorry, we couldn't find the page you're looking for."
2426
}

src/ui/not-found.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import { useTranslation } from 'react-i18next';
2+
13
interface NotFoundProps {
24
children?: React.ReactNode;
35
}
46

57
function NotFound({ children }: NotFoundProps) {
8+
const { t } = useTranslation();
9+
610
return (
711
<div className="min-h-screen bg-gray-50 flex flex-col justify-center items-center px-4">
812
<div className="max-w-md w-full text-center">
@@ -25,11 +29,9 @@ function NotFound({ children }: NotFoundProps) {
2529
<div className="mb-8">
2630
<h1 className="text-6xl font-bold text-gray-900 mb-4">404</h1>
2731
<h2 className="text-2xl font-semibold text-gray-700 mb-2">
28-
Page Not Found
32+
{t('pageNotFoundTitle')}
2933
</h2>
30-
<p className="text-gray-500 mb-8">
31-
Sorry, we couldn't find the page you're looking for.
32-
</p>
34+
<p className="text-gray-500 mb-8">{t('pageNotFoundSubtitle')}</p>
3335
</div>
3436

3537
{children}

0 commit comments

Comments
 (0)