From 782447bb124f11fa37f062cd02b0e50af11629ae Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Mon, 23 Jun 2025 22:50:03 +0200 Subject: [PATCH] add i18n support vibe coded. should not be used but I'll commit it to a separate branch just in case --- src/components/About.astro | 23 +++---- src/components/FAQ.astro | 28 +++++---- src/components/Footer.astro | 11 ++-- src/components/Hero.astro | 7 ++- src/components/Links.astro | 10 +-- src/components/Nav.astro | 54 ++++++++-------- src/components/Program.astro | 108 ++++++++++++++++---------------- src/components/Vors.astro | 7 ++- src/data/en-program.json | 66 +++++++++++--------- src/data/i18n.js | 115 +++++++++++++++++++++++++++++++++++ src/layouts/Layout.astro | 7 ++- src/pages/about.astro | 4 +- src/pages/en-program.astro | 18 ++---- src/pages/en/about.astro | 8 +++ src/pages/en/index.astro | 16 +++++ src/pages/en/program.astro | 9 +++ src/pages/index.astro | 12 ++-- src/pages/program.astro | 22 ++----- 18 files changed, 331 insertions(+), 194 deletions(-) create mode 100644 src/data/i18n.js create mode 100644 src/pages/en/about.astro create mode 100644 src/pages/en/index.astro create mode 100644 src/pages/en/program.astro diff --git a/src/components/About.astro b/src/components/About.astro index 4e644d3..5804e7e 100644 --- a/src/components/About.astro +++ b/src/components/About.astro @@ -1,18 +1,15 @@ +--- +import { translations } from '../data/i18n.js'; +const { lang = 'no' } = Astro.props; +const t = translations[lang].about; +---
-

Om STUDiO 2025

+

{t.title}

-

- STUDiO 2025 er en studentfestival som arrangeres under fadderuka i Oslo fra 11. til 15. august på Chateau Neuf. -

-

- Det blir sosiale og spennende arrangementer hver dag! Festivalen er for alle nye og gamle studenter i Oslo. Opplev høydepunktet i semesteret - ta med fadderbarna eller vennegjengen, eller kom alene og møt nye venner. -

-

- Ikke gå glipp av den største studiekickoffen i Oslo! -

-

- Flere av arrangementene våre er gratis, og alt er ID 18+. -

+

{t.p1}

+

{t.p2}

+

{t.p3}

+

{t.p4}

\ No newline at end of file diff --git a/src/components/FAQ.astro b/src/components/FAQ.astro index 74ae530..8d4b85f 100644 --- a/src/components/FAQ.astro +++ b/src/components/FAQ.astro @@ -1,25 +1,31 @@ +--- +import { translations } from '../data/i18n.js'; +const { lang = 'no' } = Astro.props; +const t = translations[lang].faq; +--- +
-

Ofte stilte spørsmål

+

{t.title}

\ No newline at end of file diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 16a204a..a4eaf50 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -3,16 +3,19 @@ import { Image } from 'astro:assets'; import logo from '@assets/logo.png'; import DNS from '@assets/DNS-logo-hvit.png'; import { FaFacebook, FaInstagram, FaTiktok } from 'react-icons/fa'; +import { translations } from '../data/i18n.js'; +const { lang = 'no' } = Astro.props; +const t = translations[lang].footer; ---