Files
fad-trade-next/i18n/routing.ts
砂糖 7f5ae85d34 feat: 重构首页并添加国际化支持
- 完全重构首页布局,添加轮播图、公司介绍、产品中心等模块
- 新增多个关于页面路由结构
- 调整国际化配置,移除日语支持并更新翻译文本
- 优化导航菜单和页脚内容
2025-11-21 15:35:36 +08:00

37 lines
878 B
TypeScript

import { createNavigation } from 'next-intl/navigation';
import { defineRouting } from 'next-intl/routing';
export const LOCALES = ['en', 'zh', 'vi']
export const DEFAULT_LOCALE = 'zh'
export const LOCALE_NAMES: Record<string, string> = {
'en': "English",
'zh': "中文",
'vi': "Tiếng Việt",
};
export const routing = defineRouting({
// A list of all locales that are supported
locales: LOCALES,
// Used when no locale matches
defaultLocale: DEFAULT_LOCALE,
// auto detect locale
localeDetection: process.env.NEXT_PUBLIC_LOCALE_DETECTION === 'true',
localePrefix: 'always',
});
// Lightweight wrappers around Next.js' navigation APIs
// that will consider the routing configuration
export const {
Link,
redirect,
usePathname,
useRouter,
getPathname,
} = createNavigation(routing);
export type Locale = (typeof routing.locales)[number];