diff --git a/src/components/Footer.astro b/src/components/Footer.astro index d7c16ba..b90a863 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,10 +1,13 @@ --- +import { useTranslations } from "../i18n/utils"; + +const tr = useTranslations(Astro.params.lang as never); --- diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index d09cb87..db71899 100644 --- a/src/components/NavBar.astro +++ b/src/components/NavBar.astro @@ -15,13 +15,13 @@ const tr = useTranslations(lang as never); diff --git a/src/i18n/en.ts b/src/i18n/en.ts index a21c270..0e828d0 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -17,8 +17,17 @@ export const en = { not_found: { title: "404 - Not found!", - description: `Looks like I haven't developed this yet! - Feel free to suggest me anything, talk to me on any of`, - social_link: "my socials!" + description: { + l1: "Looks like I haven't developed this yet!", + l2: "Feel free to suggest me anything, talk to me on any of", + socials: "my socials!" + } + }, + + footer: { + txt1: "Made with", + txt2: "by retrozinndev", + txt3: "Improve this page" } + } as const; \ No newline at end of file diff --git a/src/i18n/pt.ts b/src/i18n/pt.ts index 40425f1..0409823 100644 --- a/src/i18n/pt.ts +++ b/src/i18n/pt.ts @@ -17,8 +17,16 @@ export const pt = { not_found: { title: "404 - Não encontrado!", - description: `Parece que eu ainda não desenvolvi essa página! - Feel free to suggest me anything, talk to me on any of`, - social_link: "minhas redes sociais!" + description: { + l1: "Parece que eu ainda não desenvolvi essa página!", + l2: "Se quiser sugerir alguma ideia, me chame em qualquer uma das", + socials: "minhas redes sociais!" + } + }, + + footer: { + txt1: "Feito com", + txt2: "por retrozinndev", + txt3: "Melhore esta página" } } as const; \ No newline at end of file diff --git a/src/pages/404.astro b/src/pages/404.astro index 7b1a3dc..cefa1be 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -1,8 +1,15 @@ --- +import { getLanguageFromURL, useTranslations } from "../i18n/utils"; import "../styles/global.css"; import NavBar from "../components/NavBar.astro"; -Astro.params.lang = "en"; +Astro.params.lang = getLanguageFromURL(Astro.url); + +if(Astro.params.lang === undefined) { + Astro.params.lang = "en"; +} + +const tr = useTranslations(Astro.params.lang as never); --- @@ -17,10 +24,10 @@ Astro.params.lang = "en";
-

404!

+

{ tr("not_found.title") }

- Looks like I haven't developed this yet!
- Feel free to suggest me anything, talk to me on any of my socials! + { tr("not_found.description.l1") }
+ { tr("not_found.description.l2") } { tr("not_found.description.socials") }

diff --git a/src/pages/[lang]/index.astro b/src/pages/[lang]/index.astro index c007776..f34edd4 100644 --- a/src/pages/[lang]/index.astro +++ b/src/pages/[lang]/index.astro @@ -9,7 +9,7 @@ export { getStaticPaths }; const tr = useTranslations(Astro.params.lang as never); --- - +
@@ -18,7 +18,9 @@ const tr = useTranslations(Astro.params.lang as never);
{ tr("about.description") }
-

{ tr("about.projects") } ↗

+ +

{ tr("about.projects") } ↗

+

{ tr("about.socials_title") }