feat: English and Chinese, and selectable chat text

- settings → general → language picks system, Chinese or English; the
  choice is stored on the device and read before the first frame
- our Chinese strings are translated through tr()/trArgs() and AppText,
  with the English in lib/l10n/en_*.dart; a missing entry falls back to
  Chinese and a test checks that every literal in lib has one
- AppText rebuilds on a language change (it depends on the resolved
  locale), so const text and whole pages switch at once; the built-in
  date/time pickers and selection menu follow the same language
- server and user data (titles, messages, prompts, paths) is never
  translated
- the chat list sits in a SelectionArea: long-press selects message text
  and shows the copy/select-all menu
- bump to 0.5.2
This commit is contained in:
blumia committed 2026-11-26 09:04:25 +08:00
1 parent da4bfb6826
commit 7b5bccf28f
42 files changed
+1943 -735

No files matched your search

+183
View File
@@ -0,0 +1,183 @@
// English strings for one part of the app; merged into L10n's table. Keys are
// the Chinese text the code writes, including {0}, {1} placeholders for text
// that is built from parts.
const Map<String, String> enChat = {
'附件不能超过 10MB': 'Attachments cannot be larger than 10 MB',
// Chat app bar and transcript
'返回父会话': 'Back to parent session',
'会话': 'Session',
'文件': 'Files',
'重试': 'Retry',
'载入更早的消息': 'Load earlier messages',
'正在思考…': 'Thinking…',
'此会话由 Lead 管理,接管后才能继续。':
'This session is managed by a Lead; take it over to continue.',
'无法向子智能体会话发送提示。': 'Cannot send prompts to a subagent session.',
'无法打开子代理会话': 'Cannot open the subagent session',
// Pending prompts and message actions
'📎 {0} 个附件': '📎 {0} attachments',
'附件': 'Attachment',
'未发送': 'Not sent',
'正在转入当前回合…': 'Joining this turn…',
'已排队,本轮结束后发送': 'Queued; sends after this turn',
'改为排队': 'Queue instead',
'转为转向': 'Steer instead',
'撤回': 'Withdraw',
'复制': 'Copy',
'复制消息': 'Copy message',
'撤回此消息及之后': 'Withdraw this and later messages',
'从这里分叉': 'Fork from here',
'复制回答': 'Copy answer',
'撤回消息?': 'Withdraw message?',
'这条消息及其之后的内容会从会话中删除,且无法恢复。':
'This message and everything after it will be removed from the session '
'and cannot be recovered.',
'没有可复制的文字': 'Nothing to copy',
'已复制': 'Copied',
// Tool steps and activity
'思考': 'Thinking',
'运行': 'Run',
'读取': 'Read',
'写入': 'Write',
'编辑': 'Edit',
'补丁': 'Patch',
'搜索': 'Search',
'列出': 'List',
'抓取': 'Fetch',
'任务': 'Task',
'子代理': 'Subagent',
'技能': 'Skill',
'生成图片': 'Generate image',
'工具': 'Tool',
'后台': 'Background',
'思考中…': 'Thinking…',
'思考过程': 'Thought process',
'有步骤失败 · {0} 次工具调用': 'A step failed · {0} tool calls',
'执行中 · {0} 次工具调用': 'Running · {0} tool calls',
'已完成 · {0} 次工具调用': 'Done · {0} tool calls',
'正在{0}': '{0} in progress',
'正在回复': 'Replying',
'思考中': 'Thinking',
'{0} 秒': '{0}s',
'输出较大,正在载入…': 'Large output, loading…',
'无输出': 'No output',
'无内容': 'No content',
// Errors
'未知错误': 'Unknown error',
'压缩失败:{0}': 'Compaction failed: {0}',
'OpenCode 发送消息失败,正在重试:{0}':
'OpenCode could not send the message; retrying: {0}',
'OpenCode 发送消息失败:{0}': 'OpenCode could not send the message: {0}',
'模型的认证失败,请在服务端重新登录或检查 API Key。':
'The model failed to authenticate. Sign in again on the server or check '
'the API key.',
'本轮已停止。': 'This turn was stopped.',
'用户停止了这条命令。': 'You stopped this command.',
'停止失败:{0}': 'Could not stop: {0}',
// Compaction
'正在压缩对话': 'Compacting conversation',
'对话已压缩': 'Conversation compacted',
'隐藏摘要': 'Hide summary',
'显示摘要': 'Show summary',
'正在生成摘要…': 'Generating summary…',
'(摘要为空)': '(No summary)',
'收起详情': 'Hide details',
'显示详情': 'Show details',
// Composer
'生成中,仍可输入…': 'Generating; you can still type…',
'发消息…': 'Send a message…',
'添加附件': 'Add attachment',
'停止': 'Stop',
'发送': 'Send',
'选择失败:{0}': 'Selection failed: {0}',
'发送方式': 'Delivery',
'转向当前回合': 'Steer into this turn',
'在下一步加入,工作继续': 'Join at the next step; work continues',
'排队': 'Queue',
'等本轮结束后发送': 'Send after this turn ends',
// Permissions and forms
'请求权限: {0}': 'Permission requested: {0}',
'、': ', ',
'允许一次': 'Allow once',
'总是允许': 'Always allow',
'拒绝': 'Deny',
'取消': 'Cancel',
'请填写:{0}': 'Required: {0}',
'请选择': 'Choose one',
'其他…': 'Other…',
'{0}({1})': '{0} ({1})',
// Usage sheet
'上下文占用': 'Context usage',
'模型': 'Model',
'已用 tokens': 'Tokens used',
'上下文上限': 'Context limit',
'输出预留': 'Reserved output',
'占用': 'Usage',
'本轮费用': 'Turn cost',
'输出预留按最多 32K tokens 计算,与官方客户端一致。':
'Reserved output assumes at most 32K tokens, matching the official '
'client.',
// Images
'图片': 'Image',
'图片无法显示': 'Cannot display image',
'无效的 data URL': 'Invalid data URL',
'不支持的 data URL': 'Unsupported data URL',
'图片加载失败:{0}': 'Could not load image: {0}',
'无法预览:{0}': 'Cannot preview: {0}',
'关闭': 'Close',
// Background commands
'正在执行 {0} 条命令': 'Running {0} commands',
'已结束': 'Ended',
'停止中…': 'Stopping…',
'读取输出…': 'Reading output…',
'等待输出…': 'Waiting for output…',
'没有输出': 'No output',
'回到最新': 'Jump to latest',
'已复制输出': 'Output copied',
'后台输出': 'Background output',
'运行中': 'Running',
'查看全部': 'View all',
'停止这个任务?': 'Stop this task?',
'读取输出失败:{0}': 'Could not read output: {0}',
// Slash palette
'压缩': 'Compact',
'初始化': 'Init',
'审查': 'Review',
'目标': 'Goal',
'新建扩展': 'New extension',
'权限': 'Permission',
'计划': 'Plan',
'反馈': 'Feedback',
'没有可用的指令': 'No commands available',
'这个目录还没有注册指令或技能':
'This directory has no commands or skills yet',
// Model picker and controls
'选择模型': 'Choose model',
'正在载入模型…': 'Loading models…',
'没有结果': 'No results',
'收藏': 'Favorites',
'取消收藏': 'Remove from favorites',
'最近': 'Recent',
'其它': 'Other',
'{0} 上下文': '{0} context',
'思考强度': 'Thinking effort',
'完成': 'Done',
'模式': 'Mode',
'先规划,不改动文件': 'Plan first without changing files',
'直接构建': 'Build directly',
// Diff view
'文件 {0}': 'File {0}',
'仅显示前 {0} 行,共 {1} 行': 'Showing the first {0} of {1} lines',
};