- 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
23 lines
608 B
JavaScript
23 lines
608 B
JavaScript
// @ts-check
|
|
import { defineConfig } from 'astro/config';
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
import react from "@astrojs/react";
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
},
|
|
i18n: {
|
|
// The default locale to fall back to if a page isn't available in the active locale
|
|
defaultLocale: "en",
|
|
// A list of all locales supported by the site
|
|
locales: ["en", "zh"],
|
|
routing: {
|
|
// URLs for the defaultLocale (en) will not have a /en/ prefix
|
|
prefixDefaultLocale: false,
|
|
}
|
|
},
|
|
integrations: [react()]
|
|
}); |