feat: add Chinese Simplified (zh) locale support
This commit is contained in:
153
src/lib/i18n.ts
153
src/lib/i18n.ts
@@ -925,7 +925,157 @@ const pt: Record<keyof typeof en, string> = {
|
||||
'slash.help': 'Mostrar comandos disponíveis',
|
||||
};
|
||||
|
||||
const messages: Record<string, Record<string, string>> = { en, fr, es, de, ja, pt };
|
||||
const zh: Record<keyof typeof en, string> = {
|
||||
'login.title': 'PinchChat',
|
||||
'login.subtitle': '连接到您的 OpenClaw 网关',
|
||||
'login.gatewayUrl': '网关地址',
|
||||
'login.token': '令牌',
|
||||
'login.tokenPlaceholder': '输入网关令牌',
|
||||
'login.connect': '连接',
|
||||
'login.connecting': '连接中…',
|
||||
'login.showToken': '显示令牌',
|
||||
'login.hideToken': '隐藏令牌',
|
||||
'login.storedLocally': '凭据仅存储在浏览器本地',
|
||||
'login.wsHint': '地址必须以 ws:// 或 wss:// 开头',
|
||||
|
||||
'header.title': 'PinchChat',
|
||||
'header.connected': '已连接',
|
||||
'header.disconnected': '未连接',
|
||||
'header.logout': '退出',
|
||||
'header.toggleSidebar': '切换侧边栏',
|
||||
'header.changeLanguage': '切换语言',
|
||||
'header.soundOn': '开启通知音',
|
||||
'header.soundOff': '关闭通知音',
|
||||
|
||||
'chat.welcome': 'PinchChat',
|
||||
'chat.welcomeSub': '发送消息开始对话',
|
||||
'chat.suggestions': '试试问…',
|
||||
'chat.suggestion1': '总结我最近的邮件',
|
||||
'chat.suggestion2': '今天的日程安排是什么?',
|
||||
'chat.suggestion3': '搜索最新新闻',
|
||||
'chat.suggestion4': '帮我写一个脚本',
|
||||
'chat.loadingHistory': '加载消息中…',
|
||||
'chat.inputPlaceholder': '输入消息…',
|
||||
'chat.inputLabel': '消息',
|
||||
'chat.attachFile': '添加附件',
|
||||
'chat.send': '发送',
|
||||
'chat.stop': '停止',
|
||||
'chat.showPreview': '预览 Markdown',
|
||||
'chat.hidePreview': '隐藏预览',
|
||||
'chat.scrollToBottom': '新消息',
|
||||
'chat.scrollDown': '滚动到底部',
|
||||
'chat.collapseTools': '折叠所有工具',
|
||||
'chat.expandTools': '展开所有工具',
|
||||
'chat.messages': '聊天消息',
|
||||
'chat.thinking': '思考中…',
|
||||
|
||||
'sidebar.title': '会话',
|
||||
'sidebar.empty': '没有会话',
|
||||
'sidebar.search': '搜索会话…',
|
||||
'sidebar.noResults': '未找到匹配会话',
|
||||
'sidebar.pin': '置顶会话',
|
||||
'sidebar.unpin': '取消置顶',
|
||||
'sidebar.pinned': '已置顶',
|
||||
'sidebar.delete': '删除会话',
|
||||
'sidebar.deleteConfirm': '删除此会话?此操作无法撤消。',
|
||||
'sidebar.deleteCancel': '取消',
|
||||
'sidebar.openSplit': '在分屏中打开',
|
||||
'sidebar.close': '关闭侧边栏',
|
||||
'sidebar.clearSearch': '清除搜索',
|
||||
'sidebar.filterAll': '全部',
|
||||
'sidebar.filterActive': '活跃',
|
||||
'split.close': '关闭分屏',
|
||||
'app.mainChat': '主聊天',
|
||||
'app.splitPane': '分屏面板',
|
||||
'app.skipToChat': '跳转到输入框',
|
||||
|
||||
'thinking.label': '思考',
|
||||
'thinking.reasoning': '推理中…',
|
||||
|
||||
'tool.parameters': '参数',
|
||||
'tool.result': '结果',
|
||||
|
||||
'connection.reconnecting': '连接中断 — 正在重连…',
|
||||
'connection.reconnected': '已重新连接!',
|
||||
|
||||
'message.copy': '复制消息',
|
||||
'message.copied': '已复制!',
|
||||
'message.retry': '重新发送',
|
||||
'message.metadata': '消息详情',
|
||||
'message.rawJson': '原始 JSON',
|
||||
'message.hideRawJson': '隐藏原始 JSON',
|
||||
|
||||
'time.yesterday': '昨天',
|
||||
'time.today': '今天',
|
||||
|
||||
'shortcuts.title': '键盘快捷键',
|
||||
'shortcuts.send': '发送消息',
|
||||
'shortcuts.newline': '换行',
|
||||
'shortcuts.search': '搜索会话',
|
||||
'shortcuts.switchSession': '上一个 / 下一个会话',
|
||||
'shortcuts.closeSidebar': '关闭侧边栏 / 搜索',
|
||||
'shortcuts.stop': '停止生成',
|
||||
'shortcuts.help': '显示快捷键',
|
||||
'shortcuts.close': '关闭',
|
||||
'shortcuts.chatSection': '聊天',
|
||||
|
||||
'error.title': '出错了',
|
||||
'error.description': '渲染界面时发生意外错误。您可以重试或刷新页面。',
|
||||
'error.retry': '重试',
|
||||
'error.reload': '刷新页面',
|
||||
'shortcuts.navigationSection': '导航',
|
||||
'shortcuts.generalSection': '通用',
|
||||
|
||||
'header.export': '导出会话为 Markdown',
|
||||
'header.compact': '压缩',
|
||||
'header.compacting': '压缩中…',
|
||||
'header.sessionInfo': '会话信息',
|
||||
'sessionInfo.sessionKey': '会话密钥',
|
||||
'sessionInfo.channel': '频道',
|
||||
'sessionInfo.kind': '类型',
|
||||
'sessionInfo.model': '模型',
|
||||
'sessionInfo.agent': '智能体',
|
||||
'sessionInfo.messages': '消息数',
|
||||
'sessionInfo.totalTokens': '总令牌数',
|
||||
'sessionInfo.inputTokens': '输入',
|
||||
'sessionInfo.outputTokens': '输出',
|
||||
'sessionInfo.contextWindow': '上下文',
|
||||
'sessionInfo.lastActive': '最后活跃',
|
||||
|
||||
'theme.title': '主题',
|
||||
'theme.mode': '模式',
|
||||
'theme.accent': '强调色',
|
||||
'theme.system': '跟随系统',
|
||||
'theme.dark': '深色',
|
||||
'theme.light': '浅色',
|
||||
'theme.oled': 'OLED',
|
||||
|
||||
'search.placeholder': '搜索消息…',
|
||||
'search.noResults': '无结果',
|
||||
'search.prev': '上一个',
|
||||
'search.next': '下一个',
|
||||
'shortcuts.searchMessages': '搜索消息',
|
||||
|
||||
'settings.sendShortcut': '发送方式',
|
||||
'settings.sendEnter': 'Enter',
|
||||
'settings.sendCtrlEnter': 'Ctrl+Enter',
|
||||
|
||||
'message.bookmark': '收藏消息',
|
||||
'message.removeBookmark': '取消收藏',
|
||||
'chat.bookmarks': '收藏',
|
||||
'chat.export': '导出会话',
|
||||
'chat.contextCompacted': '上下文已压缩 — 旧消息已缓存到本地',
|
||||
'slash.commands': '命令',
|
||||
'slash.status': '显示会话状态和用量',
|
||||
'slash.reasoning': '切换推理模式',
|
||||
'slash.verbose': '切换详细输出',
|
||||
'slash.model': '切换当前会话模型',
|
||||
'slash.compact': '压缩会话上下文',
|
||||
'slash.reset': '重置会话',
|
||||
'slash.help': '显示可用命令',
|
||||
};
|
||||
|
||||
const messages: Record<string, Record<string, string>> = { en, fr, es, de, ja, pt, zh };
|
||||
|
||||
export const supportedLocales = Object.keys(messages) as string[];
|
||||
|
||||
@@ -937,6 +1087,7 @@ export const localeLabels: Record<string, string> = {
|
||||
de: 'DE',
|
||||
ja: 'JA',
|
||||
pt: 'PT',
|
||||
zh: '中文',
|
||||
};
|
||||
|
||||
function resolveInitialLocale(): string {
|
||||
|
||||
Reference in New Issue
Block a user