-
Notifications
You must be signed in to change notification settings - Fork 8
Bilingual Text and Copy
星冉 edited this page Jul 21, 2026
·
1 revision
The project manages Chinese and English in code. User-visible copy is represented by TextPair(chinese, english) under core/i18n/; callers use .get() for the current language and .format() for arguments.
-
TextPair.kt: bilingual values, language selection, and formatting. -
CommonTexts,LogTexts, andEventBusTexts: common, logging, and event copy. -
SessionTexts,SettingsTexts,AdbTexts,RemoteTexts,CodecTexts,ManagementTexts, andDebugTexts: feature-domain copy. -
LanguageManager: the single source of the active language.
Local, non-reusable copy may remain in a feature-specific text object. Only stable cross-feature copy belongs in core/i18n/.
- Titles, buttons, form labels, toasts, user-visible errors, and connection progress must provide both languages.
- Choose the owning feature domain before adding copy; create a new text object only when no existing domain fits.
- UI, ViewModels, and user-visible runtime messages call
.get()or.format()and do not duplicate language branching. - Protocol fields, enum names, internal debug keys, commands, and fixed third-party parameters are not translated.
- Infrastructure may depend on copy for its domain, but not on a specific page title or UI component.
Example:
val title = SessionTexts.EDIT_SESSION.get()
val message = AdbTexts.CONNECTION_FAILED.format(reason)- Classify the text as user-visible copy, developer diagnostics, or protocol data.
- Add or modify the
TextPairin the closest owning object. - Supply Chinese and English in the same change, with equivalent placeholders and meaning.
- Check plural meaning, punctuation, argument order, and error context.
- Search callers to prevent synonymous copy from being duplicated across objects or feature pages.
- Run relevant tests and manually inspect critical screens in both languages.
- Every retained developer technical page must have a complete English page with an English filename and a complete Chinese page with a Chinese filename.
- Chinese and English heading structure and engineering facts must be equivalent; English is not a summary.
- File names, class names, commands, and configuration keys remain unchanged.
- When a page is added, merged, split, or deleted, update both languages and their indexes in the same change.
See Documentation Maintenance Conventions for the complete workflow.
- No new user-visible raw strings.
- Both languages express the same complete fact.
- Formatting placeholders match between languages.
- Copy has a clear owner and no second resource system was introduced.
- Chinese wiki pages, English counterparts, and indexes are synchronized.
- Overview / 总览
- Quick Start / 快速开始
- Connection & Pairing / 连接设备与配对
- Session Management / 会话管理
- Remote Control / 远程控制
- Settings / 设置
- Management Features / 管理功能
- FAQ / 常见问题
- Overview / 总览
- Technical Index / 技术文档索引
- Audit Checklist / 初始化与更新清单
- Conventions / 文档维护约定
- Architecture / 架构
- Module Map / 模块地图与边界
- Runtime Path / 运行时主链路
- Session State / 会话状态与事件
- Session Lifecycle / 会话配置与连接生命周期
- ADB, USB & Wireless / ADB、USB 与无线
- ADB Lifecycle / ADB 连接生命周期
- Pairing / 设备配对与无线调试
- Codecs / 编码与解码
- Remote Interaction / 远程交互性能与悬浮菜单
- Clipboard / 剪贴板同步
- Management / 管理功能
- Events & Shell / 事件、监控与 Shell
- Logging / 日志系统与维护
- Troubleshooting / 分层排障方法
- UI Design / UI 设计系统
- Bilingual Copy / 双语与文案
- Remote UI Analysis / 远程 UI 布局分析
- Engineering Rules / 工程与验证规则
- External Research / 外部研究与取舍
Technical topics appear here only after their page-level audit is complete. / 技术主题仅在完成逐页审核后加入侧边栏。