MIGRATION_PROGRESS.md
Easydict 是一个 macOS 翻译和词典应用,正在进行从 Objective-C 到 Swift + SwiftUI 的逐步迁移。
| 服务名称 | 原文件名 | 新文件名 | 完成时间 | 提交记录 |
|---|---|---|---|---|
| Google 翻译 | EZGoogleTranslate | GoogleService | 2024-12 | refactor(objc-to-swift): migrate EZGoogleTranslate to Swift |
| Bing 翻译 | EZBingService | BingService | 2024-12 | refactor(objc-to-swift): migrate EZBingService to Swift |
| 有道翻译 | EZYoudaoTranslate | YoudaoService | 2024-12 | refactor(objc-to-swift): migrate EZYoudaoTranslate to Swift |
| NiuTrans 翻译 | EZNiuTransTranslate | NiuTransService | 2024-12 | refactor(objc-to-swift): migrate EZNiuTransTranslate to Swift |
| DeepL 翻译 | EZDeepLTranslate | DeepLService | 2024-12 | refactor(objc-to-swift): migrate EZDeepLTranslate to Swift |
| 苹果词典 | EZAppleDictionary | AppleDictionary | 2025-01 | refactor(objc-to-swift): migrate EZAppleDictionary to Swift |
| 百度翻译 | EZBaiduTranslate | BaiduService | 2025-03 | refactor(objc-to-swift): migrate EZBaiduTranslate to Swift |
| 名称 | 原文件名 | 新文件名 | 完成时间 | 提交记录 |
|---|---|---|---|---|
| 查询服务基类 | EZQueryService | QueryService | 2025-03 | refactor(objc-to-swift): migrate EZQueryService to Swift |
| 组件名称 | 原文件名 | 新文件名 | 完成时间 | 备注 |
|---|---|---|---|---|
| 文本分割 | NSString+EZSplit | String+Split | 2025-01-29 | 分割驼峰和下划线文本 |
| 输入文本处理 | NSString+EZHandleInputText | String+HandleInputText | 2025-01-29 | 完整的输入文本处理功能 |
| 字符串便利 | NSString+EZConvenience | String+Convenience | 2025-02-17 | URL 编码、剪贴板、XML 转义、MD5 等 |
| 服务名称 | 状态 | 备注 |
|---|---|---|
| OpenAI | ✅ | GPT-4 集成 |
| DeepSeek | ✅ | DeepSeek API |
| Gemini | ✅ | Google Gemini |
| Ollama | ✅ | 本地模型支持 |
| Volcano | ✅ | 火山翻译 |
| 月之暗面 | ✅ | Kimi API |
| 零一万物 | ✅ | Yi API |
| 智谱清言 | ✅ | ChatGLM |
| 通义千问 | ✅ | 阿里云大模型 |
| 腾讯混元 | ✅ | 腾讯大模型 |
| 百度文心 | ✅ | 百度大模型 |
| Coze | ✅ | 字节跳动 AI |
| 阿里通义 | ✅ | 已完成 |
| MiniMax | ✅ | 海螺 AI |
| 组件名称 | 原文件名 | 新文件名 | 状态 |
|---|---|---|---|
| 有序字典 | MMOrderedDictionary | MMOrderedDictionary | ✅ |
| AppleScript | - | AppleScriptIntegration | ✅ |
| 文本选择 | AXUI | TextSelection | ✅ |
| 离线翻译 | - | OfflineTranslation | ✅ |
| SwiftPM | - | Package.swift | ✅ |
| 暗色模式 | DarkModeManager/NSObject+DarkMode/Singleton | DarkModeManager.swift + Extensions | ✅ |
| 服务信息 | EZServiceInfo | EZServiceInfo.swift | ✅ |
| 本地存储 | EZLocalStorage | EZLocalStorage.swift | ✅ |
| 应用模型 | EZAppModel | EZAppModel.swift | ✅ |
| 服务类型 | EZServiceTypes | ServiceTypes.swift | ✅ |
| 扩展名称 | 原文件名 | 新文件名 | 状态 |
|---|---|---|---|
| 字符串布局 | - | String+Layout | ✅ |
| 颜色扩展 | NSColor+... | NSColor+... | ✅ |
| Logging | EZLog | EZLog.swift | ✅ |
| Device Info | EZDeviceSystemInfo | EZDeviceSystemInfo.swift | ✅ |
String+HandleInputText.swiftString+Split.swift 依赖文件String+HandleInputText.swift 主要实现String+HandleInputTextTests.swift 完整测试DarkModeManager.swift 统一的暗色模式管理器DarkModeProtocol.swift 提供响应式暗色模式协议NSObject+DarkMode.swift 和 NSView+DarkMode.swift 扩展AppDelegate.m 和 Configuration.swift 的调用PrefixHeader.pch 移除旧导入MIGRATION_PROGRESS.md 记录迁移进度NSString+EZConvenienceString+Convenience.swift,覆盖 URL 编码/解码、剪贴板操作、XML 转义、MD5、段落拆分等方法EZServiceInfo 到 Swift,添加 Codable 支持EZLocalStorage 到 Swift,使用现代属性访问器ServiceTypes.swift 替换 EZServiceTypes.h/.mSwift/Service/Model/EZQueryResult.swift.EZQueryResult.h/.m and updated ObjC headers to forward declarations.Swift/Utility/Logging/EZLog.swift and Swift/Utility/DeviceInfo/EZDeviceSystemInfo.swift.Easydict-Swift.h.Swift/Service/Model/DetectManager.swift with complete implementation.@objc(EZDetectManager) and @objcMembers for Objective-C compatibility.EZBaseQueryViewController.m to import Easydict-Swift.h.Easydict-Bridging-Header.h to comment out old Objective-C import.⚠️ 重要提醒:以下所有 Objective-C 组件修改时必须先迁移到 Swift,禁止直接修改!
Swift/Service/Model/DetectManager.swiftSwift/Service/Model/DetectManager.swift 完整的 Swift 实现@objc(EZDetectManager) 和 @objcMembers 保持 Objective-C 兼容性EZBaseQueryViewController.m 导入 Easydict-Swift.hEasydict-Bridging-Header.h 注释掉旧的 Objective-C 导入AppDelegate - 应用代理
objc/AppDelegate.h/.mEZWindowManager - 窗口管理器
objc/ViewController/Window/EZWindowManager.h/.mEZLocalStorage - 本地存储 ✅
objc/ViewController/Storage/EZLocalStorage.swiftobjc/ViewController/Window/BaseQueryWindow/EZBaseQueryViewController.m🚨 重要约束:禁止添加新的 Objective-C 代码,所有重写必须使用 Swift
最后更新: 2025-12-22