feat: add translation for not-found

This commit is contained in:
JiPai 2024-09-05 20:25:11 +08:00
parent 137c219402
commit 27b83e471e
3 changed files with 16 additions and 5 deletions

View File

@ -1,8 +1,10 @@
import Link from 'next/link'
import { Footer } from './Footer'
import { Header } from './Header'
import { useTranslations } from 'next-intl'
export function SlimLayout({ children }: { children: React.ReactNode }) {
export function SlimLayout() {
const t = useTranslations('404')
return (
<>
<div>
@ -14,14 +16,13 @@ export function SlimLayout({ children }: { children: React.ReactNode }) {
404
</h1>
<p className="mb-4 text-lg text-muted-foreground">
Oops! Looks like you're lost.
{t('title')}
</p>
<p className="mt-4 text-muted-foreground">
Let's get you back{' '}
{t('des')}{' '}
<Link href="/" className="text-primary">
home
{t('action')}
</Link>
.
</p>
</div>
</main>

View File

@ -78,5 +78,10 @@
"footer": {
"copyright": "Copyright © {year} Dokploy. All rights reserved."
}
},
"404": {
"title": "Oops! Looks like you're lost.",
"des": "Let's get you back",
"action": "home"
}
}

View File

@ -78,5 +78,10 @@
"footer": {
"copyright": "版权属于 © {year} Dokploy 保留所有权利"
}
},
"404": {
"title": "糟糕!看起来你迷路了。",
"des": "让我们送你",
"action": "回家"
}
}