- Add multi-language support using next-intl - Configure routing and localization for English and Chinese - Update project structure to support i18n routing - Add middleware and navigation helpers for localized routing - Create message files for translations - Modify layout and page components to support internationalization
21 lines
406 B
TypeScript
21 lines
406 B
TypeScript
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
|
|
|
interface AboutPageProps {
|
|
params: { locale: string };
|
|
};
|
|
|
|
export default async function AboutPage({ params }: AboutPageProps) {
|
|
const { locale } = params;
|
|
|
|
// Enable static rendering
|
|
setRequestLocale(locale);
|
|
|
|
const t = await getTranslations('AboutPage');
|
|
|
|
return (
|
|
<div>
|
|
<h1>{t('title')}</h1>
|
|
</div>
|
|
);
|
|
}
|