feat(i18n): implement internationalization support for en and zh
Add i18n infrastructure with translation files and utility functions Update components to use translations and language switching Create localized pages for en and zh languages Add language detection and path localization utilities
This commit is contained in:
@@ -1,24 +1,27 @@
|
||||
---
|
||||
import { type Lang, useTranslations } from "@/i18n/utils";
|
||||
import "../styles/global.css";
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
lang: Lang;
|
||||
}
|
||||
|
||||
const { title = "Rishikesh S - Portfolio", description = "My Portfolio" } =
|
||||
const { title = "Rishikesh S - Portfolio", description = "My Portfolio", lang } =
|
||||
Astro.props;
|
||||
const t = useTranslations(lang);
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang={lang}>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<meta name="description" content={description} />
|
||||
<title>{title}</title>
|
||||
<title>{title}{t('site.title') ? ` | ${t('site.title')}` : ''}</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
|
||||
Reference in New Issue
Block a user