diff --git a/src/pages/404.astro b/src/pages/404.astro index c0e1577..e6b4bb2 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -5,14 +5,14 @@ import Btn404 from "@components/ui/buttons/Btn404.astro"; import { SITE } from "@data/constants"; // Define types for translations -type TranslationKeys = 'en' | 'fr'; +type TranslationKeys = "en" | "fr"; type Translations = { [key in TranslationKeys]: { pageTitle: string; subTitle: string; content: string; btnTitle: string; - } + }; }; // Define variables for page content @@ -21,21 +21,25 @@ const translations: Translations = { en: { pageTitle: `Page Not Found | ${SITE.title}`, subTitle: "Oops, this isn't the tool you were looking for!", - content: "Don't let this hiccup slow you down. Let's get you back to building your masterpiece.", + content: + "Don't let this hiccup slow you down. Let's get you back to building your masterpiece.", btnTitle: "Go Back", }, fr: { pageTitle: `Page Non Trouvée | ${SITE.title}`, subTitle: "Oops, ce n'est pas l'outil que vous recherchiez!", - content: "Ne laissez pas ce contretemps vous ralentir. Revenons à la construction de votre chef-d'œuvre.", + content: + "Ne laissez pas ce contretemps vous ralentir. Revenons à la construction de votre chef-d'œuvre.", btnTitle: "Retournez", - } + }, }; // Determine language from the URL const urlPath = Astro.url.pathname; const langCodeMatch = urlPath.match(/^\/(en|fr)\//); -const lang: TranslationKeys = langCodeMatch ? langCodeMatch[1] as TranslationKeys : defaultLang; +const lang: TranslationKeys = langCodeMatch + ? (langCodeMatch[1] as TranslationKeys) + : defaultLang; const { pageTitle, subTitle, content, btnTitle } = translations[lang]; --- @@ -44,13 +48,21 @@ const { pageTitle, subTitle, content, btnTitle } = translations[lang];
-

+

404

-

+

{subTitle}

-

+

{content}

@@ -61,8 +73,10 @@ const { pageTitle, subTitle, content, btnTitle } = translations[lang]; -