feat(i18n): add multilingual support for documentation with Chinese and English content

This commit is contained in:
HouYunFei
2026-08-05 14:41:42 +08:00
parent 5a7116f924
commit ec82958f7c
82 changed files with 2400 additions and 1473 deletions
+15
View File
@@ -0,0 +1,15 @@
import { defineI18n } from 'fumadocs-core/i18n';
export type Locale = 'en' | 'zh-CN';
export const i18n = defineI18n({
defaultLanguage: 'en',
languages: ['en', 'zh-CN'],
parser: 'dot',
hideLocale: 'default-locale',
fallbackLanguage: null,
});
export function localizePath(locale: string, path: string) {
return locale === i18n.defaultLanguage ? path : `/${locale}${path}`;
}