From 27b83e471eb3386c58d1da5f04c204c61d9507b6 Mon Sep 17 00:00:00 2001 From: JiPai Date: Thu, 5 Sep 2024 20:25:11 +0800 Subject: [PATCH] feat: add translation for not-found --- apps/website/components/SlimLayout.tsx | 11 ++++++----- apps/website/locales/en.json | 5 +++++ apps/website/locales/zh-Hans.json | 5 +++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/website/components/SlimLayout.tsx b/apps/website/components/SlimLayout.tsx index dd4385cc0..7b2b83ef0 100644 --- a/apps/website/components/SlimLayout.tsx +++ b/apps/website/components/SlimLayout.tsx @@ -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 ( <>
@@ -14,14 +16,13 @@ export function SlimLayout({ children }: { children: React.ReactNode }) { 404

- Oops! Looks like you're lost. + {t('title')}

- Let's get you back{' '} + {t('des')}{' '} - home + {t('action')} - .

diff --git a/apps/website/locales/en.json b/apps/website/locales/en.json index 8de4e297d..efb3cfcb7 100644 --- a/apps/website/locales/en.json +++ b/apps/website/locales/en.json @@ -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" } } diff --git a/apps/website/locales/zh-Hans.json b/apps/website/locales/zh-Hans.json index 2f4f40d88..cbd848e30 100644 --- a/apps/website/locales/zh-Hans.json +++ b/apps/website/locales/zh-Hans.json @@ -78,5 +78,10 @@ "footer": { "copyright": "版权属于 © {year} Dokploy, 保留所有权利" } + }, + "404": { + "title": "糟糕!看起来你迷路了。", + "des": "让我们送你", + "action": "回家" } }