diff --git a/locales/de/translation.json b/locales/de/translation.json index 2d3295e..24f3248 100644 --- a/locales/de/translation.json +++ b/locales/de/translation.json @@ -84,5 +84,10 @@ }, "sections": "Rubriken", "posts": "Beiträge" + }, + "not_found": { + "title": "Nicht Gefunden", + "titleExt": "Seite Nicht Gefunden", + "text": "Ups... Diese Seite existiert nicht, also gehen wir am besten <1>zurück zur Startseite und probieren es nochmal." } } diff --git a/locales/en/translation.json b/locales/en/translation.json index b0dbb84..b507ec8 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -84,5 +84,10 @@ }, "sections": "Sections", "posts": "Posts" + }, + "not_found": { + "title": "Not Found", + "titleExt": "Page Not Found", + "text": "Whoops... That page doesn't exist, so you may as well <1>go home." } } diff --git a/src/pages/404.js b/src/pages/404.js index 756fcbe..7e0305f 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,16 +1,21 @@ import * as React from "react"; -import { Link } from "gatsby-plugin-react-i18next"; +import { Link, useTranslation, Trans } from "gatsby-plugin-react-i18next"; import Layout from "../layouts/default"; +import { graphql } from "gatsby"; const NotFoundPage = () => { + const { t } = useTranslation(); + return ( - +
-

Page not found

+

{t("not_found.titleExt")}

- Whoops... That page doesn't exist, so you may as - well go home. + }} + />

@@ -18,4 +23,18 @@ const NotFoundPage = () => { ); }; +export const query = graphql` + query ($language: String) { + locales: allLocale(filter: { language: { eq: $language } }) { + edges { + node { + ns + data + language + } + } + } + } +`; + export default NotFoundPage;