--- import ThemeToggle from './ThemeToggle.astro'; import { getLocalizedPath, LANG_LABELS, useTranslations, type Lang } from '../lib/i18n'; interface Props { lang: Lang; } const { lang } = Astro.props; const t = useTranslations(lang); const otherLang: Lang = lang === 'en' ? 'pt' : 'en'; const pathname = Astro.url.pathname; const homeHref = getLocalizedPath('/', lang); const postsHref = getLocalizedPath('/posts', lang); const aboutHref = getLocalizedPath('/about', lang); const langSwitchHref = getLocalizedPath(pathname, otherLang); const navLinks = [ { href: homeHref, label: t('nav.home') }, { href: postsHref, label: t('nav.posts') }, { href: aboutHref, label: t('nav.about') }, ]; function isActive(href: string): boolean { if (href === homeHref) return pathname === href; return pathname === href || pathname.startsWith(`${href}/`); } ---
{t('site.name')}
{otherLang}