mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-05 04:07:36 +08:00
- Updated the demo API to support locale-based content rendering. - Refactored the main layout to accommodate language-specific metadata and routing. - Introduced new components for blog and documentation pages, ensuring proper language handling. - Added styles for improved UI consistency across different sections. - Removed deprecated layout files and streamlined the structure for better maintainability.
26 lines
617 B
TypeScript
26 lines
617 B
TypeScript
import { defineI18n } from 'fumadocs-core/i18n';
|
|
|
|
export const i18n = defineI18n({
|
|
defaultLanguage: 'zh',
|
|
languages: ['zh', 'en'],
|
|
hideLocale: 'default-locale',
|
|
});
|
|
|
|
export type Language = (typeof i18n)['languages'][number];
|
|
|
|
export function isLanguage(value: string): value is Language {
|
|
return i18n.languages.some((lang) => lang === value);
|
|
}
|
|
|
|
/** HTML `lang` attribute values. */
|
|
export const htmlLang: Record<Language, string> = {
|
|
zh: 'zh-CN',
|
|
en: 'en',
|
|
};
|
|
|
|
/** Locale ids understood by the desktop app / demo. */
|
|
export const demoLocale: Record<Language, string> = {
|
|
zh: 'zh-CN',
|
|
en: 'en-US',
|
|
};
|