i18n init
This commit is contained in:
34
client/src/pages/[lang]/index.astro
Normal file
34
client/src/pages/[lang]/index.astro
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
// Import necessary components and utilities
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import BigCard from "../../components/BigCard.astro";
|
||||
import { t, isSupportedLanguage, type SupportedLanguage, DEFAULT_LANGUAGE } from "../../lib/i18n";
|
||||
|
||||
// Get language from URL parameter
|
||||
const { lang } = Astro.params;
|
||||
|
||||
// Validate language parameter
|
||||
if (!lang || !isSupportedLanguage(lang)) {
|
||||
return Astro.redirect('/');
|
||||
}
|
||||
|
||||
const currentLang = lang as SupportedLanguage;
|
||||
|
||||
// If it's the default language (Spanish), redirect to root
|
||||
if (currentLang === DEFAULT_LANGUAGE) {
|
||||
return Astro.redirect('/');
|
||||
}
|
||||
---
|
||||
|
||||
<Layout title={t('nav.home', currentLang)} description="Pole Elements">
|
||||
<div class="container mx-auto p-4">
|
||||
<div class="py-12">
|
||||
<BigCard
|
||||
url={`/${currentLang}/elements`}
|
||||
title={t('elements.title', currentLang)}
|
||||
description="Explore a comprehensive collection of pole dance elements, techniques, and combinations. From basic spins to advanced tricks, discover everything you need to master pole sport."
|
||||
ctaText={t('elements.view', currentLang)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user