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

View File

@@ -78,5 +78,10 @@
"footer": { "footer": {
"copyright": "Copyright © {year} Dokploy. All rights reserved." "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": { "footer": {
"copyright": "版权属于 © {year} Dokploy 保留所有权利" "copyright": "版权属于 © {year} Dokploy 保留所有权利"
} }
},
"404": {
"title": "糟糕!看起来你迷路了。",
"des": "让我们送你",
"action": "回家"
} }
} }