export const messages = { zh: { nav: { articles: '文章', about: '关于', cron: '定时任务', settings: '设置' }, home: { title: '我的编程学习记录', empty: '暂无文章', loading: '加载中...', newPost: '新建文章' }, about: { title: '关于我', intro: '你好!我是一名热爱技术开发的开发者。', blog: '这个博客用于分享我在学习和工作中的一些心得体会。', tech: '技术栈', features: '功能特点', feature1: '定时任务系统 - 支持 Cron表达式的自动化任务管理', feature2: '自定义背景 - 支持纯色和图片背景,可调节透明度', feature3: '多语言支持 - 中英文切换', feature4: '自定义图标 - 上传本地图片作为网站图标', contact: '联系方式', contactDesc: '如果你有任何问题或建议,欢迎通过以下方式联系我:', filingNumber: '桂ICP备2022004108号-1' }, settings: { title: '设置', language: '语言设置', interfaceLang: '界面语言', background: '背景设置', bgType: '背景类型', solid: '纯色', image: '图片', bgColor: '背景颜色', bgImage: '背景图片', opacity: '背景透明度', preview: '预览', uploadImage: '上传本地图片', uploading: '上传中...', localImage: '本地图片', clear: '清除', imageUrlPlaceholder: '或输入图片URL', saved: '已保存', siteIcon: '网站图标', uploadIcon: '上传图标', defaultIcon: '恢复默认', myIcons: '我的图标库', myImages: '我的图片库' }, serverConfig: { title: '服务端配置', database: '数据库配置', rustfs: 'RUSTFS 对象存储', server: '服务器配置', dbHost: '主机', dbPort: '端口', dbUser: '用户名', dbPassword: '密码', dbName: '数据库名', rustfsEndpoint: '端点地址', rustfsRegion: '区域', rustfsBucket: '存储桶', rustfsAccessKey: '访问密钥', rustfsSecretKey: '密钥', serverPort: '端口', passwordPlaceholder: '留空则不修改', save: '保存配置', saving: '保存中...', saved: '配置已保存', saveFailed: '保存失败', restart: '重启服务', restarting: '重启中...', restartFailed: '重启失败', confirmRestart: '确定要重启后端服务吗?', loading: '加载中...' }, cron: { title: '定时任务处理系统', newTask: '新建任务', editTask: '编辑任务', usage: '使用说明', cronFormat: 'Cron表达式格式:分 时 日 月 周,例如*/5 * * * * 表示每5分钟执行', supportedSymbols: '支持的符号:*任意值,*/n每n个时间单位,,列表,-范围', headersFormat: '请求头格式:JSON对象,例如 {"Content-Type": "application/json"}', empty: '暂无定时任务,点击"新建任务"添加第一个任务', disabled: '已禁用', running: '执行中', success: '成功', error: '失败', nextRun: '下次执行', lastRun: '上次执行', runCount: '累计执行', executing: '执行中...', runNow: '立即执行', disable: '禁用', enable: '启用', edit: '编辑', delete: '删除', taskName: '任务名称', taskNamePlaceholder: '例如:每隔5分钟同步数据', cronExpression: 'Cron表达式', cronHint: '分 时 日 月 周', requestMethod: '请求方法', requestURL: '请求URL', requestHeaders: '请求头', requestBody: '请求体', enableTask: '启用任务', cancel: '取消', save: '保存' }, postEditor: { newTitle: '新建文章', editTitle: '编辑文章', title: '标题', date: '日期', excerpt: '摘要', excerptPlaceholder: '文章摘要(可选)', content: '正文', contentPlaceholder: '文章正文内容...', save: '保存', saving: '保存中...', cancel: '取消', titleRequired: '标题和日期是必填项', saveFailed: '保存失败', loadFailed: '加载文章失败' } }, en: { nav: { articles: 'Articles', about: 'About', cron: 'Cron Jobs', settings: 'Settings' }, home: { title: 'My Programming Learning Blog', empty: 'No articles yet', loading: 'Loading...', newPost: 'New Post' }, about: { title: 'About Me', intro: 'Hello! I am a developer passionate about technology.', blog: 'This blog is for sharing my insights and experiences in learning and work.', tech: 'Tech Stack', features: 'Features', feature1: 'Cron Job System - Automated task management with Cron expressions', feature2: 'Custom Background - Solid color and image backgrounds with adjustable opacity', feature3: 'Multi-language Support - Chinese and English switching', feature4: 'Custom Icon - Upload local images as website icon', contact: 'Contact', contactDesc: 'If you have any questions or suggestions, feel free to contact me:', filingNumber: '桂ICP备2022004108号-1' }, settings: { title: 'Settings', language: 'Language Settings', interfaceLang: 'Interface Language', background: 'Background Settings', bgType: 'Background Type', solid: 'Solid Color', image: 'Image', bgColor: 'Background Color', bgImage: 'Background Image', opacity: 'Background Opacity', preview: 'Preview', uploadImage: 'Upload Local Image', uploading: 'Uploading...', localImage: 'Local Image', clear: 'Clear', imageUrlPlaceholder: 'or enter image URL', saved: 'Saved', siteIcon: 'Site Icon', uploadIcon: 'Upload Icon', defaultIcon: 'Reset Default', myIcons: 'My Icons', myImages: 'My Images' }, serverConfig: { title: 'Server Config', database: 'Database', rustfs: 'RUSTFS Object Storage', server: 'Server', dbHost: 'Host', dbPort: 'Port', dbUser: 'User', dbPassword: 'Password', dbName: 'Database', rustfsEndpoint: 'Endpoint', rustfsRegion: 'Region', rustfsBucket: 'Bucket', rustfsAccessKey: 'Access Key', rustfsSecretKey: 'Secret Key', serverPort: 'Port', passwordPlaceholder: 'Leave empty to keep unchanged', save: 'Save Config', saving: 'Saving...', saved: 'Config saved', saveFailed: 'Save failed', restart: 'Restart Server', restarting: 'Restarting...', restartFailed: 'Restart failed', confirmRestart: 'Are you sure you want to restart the server?', loading: 'Loading...' }, cron: { title: 'Cron Job System', newTask: 'New Task', editTask: 'Edit Task', usage: 'Usage Instructions', cronFormat: 'Cron format: min hour day month week, e.g. */5 * * * * means every 5 minutes', supportedSymbols: 'Supported symbols: * any value, */n every n units, , list, - range', headersFormat: 'Headers format: JSON object, e.g. {"Content-Type": "application/json"}', empty: 'No cron tasks yet. Click "New Task" to add your first task.', disabled: 'Disabled', running: 'Running', success: 'Success', error: 'Failed', nextRun: 'Next Run', lastRun: 'Last Run', runCount: 'Run Count', executing: 'Executing...', runNow: 'Run Now', disable: 'Disable', enable: 'Enable', edit: 'Edit', delete: 'Delete', taskName: 'Task Name', taskNamePlaceholder: 'e.g., Sync data every 5 minutes', cronExpression: 'Cron Expression', cronHint: 'min hour day month week', requestMethod: 'Request Method', requestURL: 'Request URL', requestHeaders: 'Request Headers', requestBody: 'Request Body', enableTask: 'Enable Task', cancel: 'Cancel', save: 'Save' }, postEditor: { newTitle: 'New Post', editTitle: 'Edit Post', title: 'Title', date: 'Date', excerpt: 'Excerpt', excerptPlaceholder: 'Post excerpt (optional)', content: 'Content', contentPlaceholder: 'Post content...', save: 'Save', saving: 'Saving...', cancel: 'Cancel', titleRequired: 'Title and date are required', saveFailed: 'Save failed', loadFailed: 'Failed to load post' } } } export function t(key, locale = 'zh') { const keys = key.split('.') let value = messages[locale] for (const k of keys) { value = value?.[k] } return value || key }