diff --git a/i18n.json b/i18n.json index 110c856..0133d43 100644 --- a/i18n.json +++ b/i18n.json @@ -9,6 +9,7 @@ "/house": ["house", "common"], "/tos": ["tos", "common"], "/hcunews": ["hcunews", "common"], - "/minecraft": ["minecraft", "common"] + "/minecraft": ["minecraft", "common"], + "/404": ["404", "common"] } } \ No newline at end of file diff --git a/locales/en/404.json b/locales/en/404.json new file mode 100644 index 0000000..d29c078 --- /dev/null +++ b/locales/en/404.json @@ -0,0 +1,4 @@ +{ + "caption": "The requested page does not exist on this website.", + "return": "Return to top" +} \ No newline at end of file diff --git a/locales/ja/404.json b/locales/ja/404.json new file mode 100644 index 0000000..fa12291 --- /dev/null +++ b/locales/ja/404.json @@ -0,0 +1,4 @@ +{ + "caption": "要求されたページはこのウェブサイト上に存在しません。", + "return": "トップページへ戻る" +} \ No newline at end of file diff --git a/pages/404.js b/pages/404.js new file mode 100644 index 0000000..94b9426 --- /dev/null +++ b/pages/404.js @@ -0,0 +1,29 @@ +// Base layout +import Layout from "./components/Layout" + +// React Router +import { useRouter } from 'next/router' + +// Next.js +import Link from 'next/link' +import useTranslation from 'next-translate/useTranslation' + +export default function Custom404(props) { + const router = useRouter() + const { locale, locales, defaultLocale, pathname } = router + const { t, lang } = useTranslation("404") + + return ( + +
+

404

+

{t('caption')}

+ + +

{t('return')}

+
+ +
+
+ ) +} \ No newline at end of file