mirror of
https://github.com/basketikun/infinite-canvas.git
synced 2026-08-06 09:24:24 +08:00
feat(i18n): add multilingual support for documentation with Chinese and English content
This commit is contained in:
@@ -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}`;
|
||||
}
|
||||
Reference in New Issue
Block a user