Personal site staging.colinozanne.co.uk
portfolio astro

fix: replace prop with locale conditional for subtitle

finxol.io e9d677a2 6d62d0fe

verified
+5 -8
+5 -8
src/layouts/Layout.astro
··· 7 7 import colinPng from "@/assets/img/colin.png"; 8 8 import colinWebp from "@/assets/img/colin.webp"; 9 9 10 - // Define the props interface 11 - interface Props { 12 - subtitle: string; 13 - } 14 - 15 - // Destructure the prop 16 - const { subtitle } = Astro.props; 17 - 18 10 const path = Astro.originPathname.replace(/\/(fr|en)\//, "/"); 19 11 const locale = Astro.currentLocale; 12 + 13 + const subtitle = 14 + locale === "fr" 15 + ? "Étudiant M1 Informatique" 16 + : "Master's Computer Science Student"; 20 17 --- 21 18 22 19 <!doctype html>