refactor(i18n): simplify language handling across components

use Astro.currentLocale as single source of truth for language
remove manual lang prop passing to components
components now read language from document lang attribute
This commit is contained in:
joyzhao
2025-06-19 10:24:48 +08:00
parent 4621223d26
commit c1f240d007
10 changed files with 78 additions and 22 deletions

View File

@@ -39,7 +39,7 @@ const lang = Astro.currentLocale as Lang || defaultLang;
<div class="absolute inset-0 bg-gradient-to-br from-purple-50/30 via-transparent to-blue-50/20 dark:from-purple-950/20 dark:via-transparent dark:to-blue-950/10"></div>
</div>
<!-- Glass Header with navigation -->
<GlassHeader lang={lang} client:load />
<GlassHeader client:load />
<!-- Main content with proper spacing for fixed header -->
<div class="pt-16">
@@ -47,7 +47,7 @@ const lang = Astro.currentLocale as Lang || defaultLang;
</div>
<!-- Footer -->
<Footer lang={lang} client:load />
<Footer client:load />
</body>
</html>