feat(i18n): implement astro i18n integration and refactor locale handling
- Add i18n configuration to astro.config.mjs with default locale and routing - Refactor language handling to use Astro.currentLocale instead of URL parsing - Update tsconfig to include only necessary files for better type checking - Improve LanguageSwitcher to handle routing based on astro i18n config - Add new translation keys and update components to use dynamic titles - Simplify MotionWrapper component by removing unused default animations
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
---
|
||||
import { type Lang, useTranslations } from "@/i18n/utils";
|
||||
import { useTranslations, type Lang } from "@/i18n/utils";
|
||||
import { defaultLang } from "@/i18n/ui";
|
||||
import "../styles/global.css";
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
lang: Lang;
|
||||
}
|
||||
|
||||
const { title = "Rishikesh S - Portfolio", description = "My Portfolio", lang } =
|
||||
const lang = Astro.currentLocale as Lang || defaultLang;
|
||||
const { title = "Rishikesh S - Portfolio", description = "My Portfolio" } =
|
||||
Astro.props;
|
||||
const t = useTranslations(lang);
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user