mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-05-02 11:46:19 +02:00
Localize 404 page
This commit is contained in:
parent
7894afe62c
commit
b7d9e71259
3 changed files with 34 additions and 5 deletions
|
@ -84,5 +84,10 @@
|
||||||
},
|
},
|
||||||
"sections": "Rubriken",
|
"sections": "Rubriken",
|
||||||
"posts": "Beiträge"
|
"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</1> und probieren es nochmal."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,5 +84,10 @@
|
||||||
},
|
},
|
||||||
"sections": "Sections",
|
"sections": "Sections",
|
||||||
"posts": "Posts"
|
"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</1>."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
import * as React from "react";
|
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 Layout from "../layouts/default";
|
||||||
|
import { graphql } from "gatsby";
|
||||||
|
|
||||||
const NotFoundPage = () => {
|
const NotFoundPage = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Not found">
|
<Layout title={t("not_found.title")}>
|
||||||
<section>
|
<section>
|
||||||
<article>
|
<article>
|
||||||
<h1>Page not found</h1>
|
<h1>{t("not_found.titleExt")}</h1>
|
||||||
<p>
|
<p>
|
||||||
Whoops... That page doesn't exist, so you may as
|
<Trans
|
||||||
well <Link to="/">go home</Link>.
|
i18nKey="not_found.text"
|
||||||
|
components={{ 1: <Link to="/" /> }}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
@ -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;
|
export default NotFoundPage;
|
||||||
|
|
Loading…
Add table
Reference in a new issue