feat(i18n): integrate internationalization into sidebar, title bar, and settings components
- Added useI18n hook to Sidebar and TitleBar components for translation support. - Updated sidebar navigation items to use translation keys instead of hardcoded labels. - Enhanced TitleBar buttons with localized titles for minimize, maximize, and close actions. - Expanded i18n constants to include new namespaces for sidebar and login. - Implemented translation messages for sidebar, settings, and login components in English, Chinese, and Japanese. - Refactored Knowledge and Skills pages to utilize useLocale for locale management. - Updated Login page to display localized text for form labels, placeholders, and error messages. - Enhanced Account and General settings panels with localized titles and descriptions. - Modified SettingMenu to use translation keys for menu items.
This commit is contained in:
@@ -12,20 +12,26 @@ export type WorkspacePath = Exclude<AppPath, '/login'>;
|
||||
|
||||
export type NavItem = {
|
||||
path: WorkspacePath;
|
||||
label: string;
|
||||
description: string;
|
||||
labelKey:
|
||||
| 'sidebar.home'
|
||||
| 'sidebar.knowledge'
|
||||
| 'sidebar.models'
|
||||
| 'sidebar.skills'
|
||||
| 'sidebar.cron'
|
||||
| 'sidebar.scripts'
|
||||
| 'sidebar.settings';
|
||||
};
|
||||
|
||||
export const DEFAULT_PATH: WorkspacePath = '/home';
|
||||
|
||||
export const NAV_ITEMS: NavItem[] = [
|
||||
{ path: '/home', label: '首页', description: '对话与首页入口' },
|
||||
{ path: '/knowledge', label: '知识库', description: '知识库与内容管理' },
|
||||
{ path: '/agents', label: '模型', description: '智能体与提供方' },
|
||||
{ path: '/skills', label: '技能', description: '技能与能力集' },
|
||||
{ path: '/cron', label: '定时任务', description: '计划与调度' },
|
||||
{ path: '/scripts', label: '脚本', description: '脚本与自动化' },
|
||||
{ path: '/setting', label: '设置', description: '应用配置' },
|
||||
{ path: '/home', labelKey: 'sidebar.home' },
|
||||
{ path: '/knowledge', labelKey: 'sidebar.knowledge' },
|
||||
{ path: '/agents', labelKey: 'sidebar.models' },
|
||||
{ path: '/skills', labelKey: 'sidebar.skills' },
|
||||
{ path: '/cron', labelKey: 'sidebar.cron' },
|
||||
{ path: '/scripts', labelKey: 'sidebar.scripts' },
|
||||
{ path: '/setting', labelKey: 'sidebar.settings' },
|
||||
];
|
||||
|
||||
export function normalizeWorkspacePath(pathname: string): WorkspacePath {
|
||||
|
||||
Reference in New Issue
Block a user