diff --git a/AGENTS.md b/AGENTS.md index 95fb296..64cbc0a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ - UI: Tailwind CSS v4 (brand tokens: `--color-brand`, `--color-brand-600`). - Icons: `lucide-astro` inline SVGs; use `text-brand` for accent. - JS: vanilla only (no jQuery). Prefer lightweight patterns (e.g., scrollBy carousels). -- i18n: use `hrefFor()` and `siblingPath()` for all internal links and language toggles. +- i18n: prefer `getRelativeLocaleUrl()` from `astro:i18n` for links; use `siblingPath()` for toggles when slugs differ. - Content slugs differ by locale (e.g., FR `avis` ↔ EN `reviews`) — never hardcode. ## Testing Guidelines diff --git a/astro.config.mjs b/astro.config.mjs index 508cbec..1405559 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,11 +1,19 @@ // @ts-check -import { defineConfig } from 'astro/config'; +import { defineConfig } from "astro/config"; -import tailwindcss from '@tailwindcss/vite'; +import tailwindcss from "@tailwindcss/vite"; // https://astro.build/config export default defineConfig({ + i18n: { + locales: ["fr", "en"], + defaultLocale: "fr", + routing: { + prefixDefaultLocale: true, + redirectToDefaultLocale: true, + }, + }, vite: { - plugins: [tailwindcss()] - } -}); \ No newline at end of file + plugins: [tailwindcss()], + }, +}); diff --git a/dist/index.html b/dist/index.html index e69de29..e6797cf 100644 --- a/dist/index.html +++ b/dist/index.html @@ -0,0 +1 @@ +
/ to /fr
\ No newline at end of file
diff --git a/src/i18n/routes.ts b/src/i18n/routes.ts
index 4c05c94..c965b52 100644
--- a/src/i18n/routes.ts
+++ b/src/i18n/routes.ts
@@ -1,78 +1,67 @@
-export type Locale = 'fr' | 'en';
+export type Locale = "fr" | "en";
export type RouteKey =
- | 'home'
- | 'apartments'
- | 'apartment_t2'
- | 'apartment_t3'
- | 'reviews'
- | 'location'
- | 'rates'
- | 'contact'
- | 'thank_you'
- | 'terms'
- | 'privacy'
- | 'cancellation'
- | 'house_rules';
+ | "home"
+ | "apartments"
+ | "apartment_t2"
+ | "apartment_t3"
+ | "reviews"
+ | "location"
+ | "rates"
+ | "contact"
+ | "thank_you"
+ | "terms"
+ | "privacy"
+ | "cancellation"
+ | "house_rules";
export const routes: Record