Repository navigation
fix: add missing tr() sources to .pro and regenerate translations - #693
Conversation
|
Sorry @pengfeixx, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 11 hours and 5 minutes by commenting |
Reviewer's GuideThe PR fixes the Qt translation pipeline by adding the iFlytek assistant files to the qmake SOURCES/HEADERS lists, then regenerating the Chinese catalog so three existing translations are emitted into the runtime .qm instead of falling back to English; the broad location-only catalog changes are generated metadata updates. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
b0fff6a to
161b650
Compare
161b650 to
1929dbd
Compare
1. Root cause: src/deepin-editor.pro SOURCES/HEADERS was missing four files containing tr() calls: common/iflytek_ai_assistant.cpp/.h, common/text_file_saver.cpp, editor/markdown/markdownbridge.h and widgets/pathsettintwgt.cpp/.h. lupdate never scanned them, so their existing translations were marked "vanished" in the .ts catalogs and lrelease dropped them from .qm; runtime tr() fell back to English 2. Fix: add all missing files to the .pro lists, then regenerate deepin-editor.ts / zh_CN / zh_HK / zh_TW via lupdate. Per language 16 vanished entries become active with their existing translations: 3 iflytek prompts, 8 file-save error prompts (text_file_saver), 5 markdown code-block prompts (MarkdownBridge). Also fill all remaining unfinished entries: the new "Save aborted: editor is closing" prompt in zh_CN/zh_HK/zh_TW and 16 template entries (translation mirrors source) 3. Impact: voice read-aloud/dictation prompts, file-save error messages and markdown code-block actions now display Chinese (Simplified and Traditional); no code logic or build behavior changed. Remaining languages recover via the Transifex sync now that the .pro is complete. The stale "视图模式" entry (Chinese-literal source from an old iteration, superseded by the active "View Mode" entry) is removed from all catalogs Log: Fix English fallback for prompts from files missing in .pro Influence: 1. Test voice read-aloud/dictation with audio devices disabled 2. Test saving a large file / read-only file to see Chinese error prompts 3. Test markdown code block collapse/expand/copy tooltips 4. Verify settings path labels stay Chinese (PR linuxdeepin#694 not regressed) 5. Verify other translated strings remain correct fix: 补全 .pro 缺失的翻译源文件并重新生成翻译 1. 根因:src/deepin-editor.pro 的 SOURCES/HEADERS 列表缺少四个含 tr() 调用的文件:common/iflytek_ai_assistant.cpp/.h、 common/text_file_saver.cpp、editor/markdown/markdownbridge.h、 widgets/pathsettintwgt.cpp/.h。lupdate 从未扫描过它们,已有译文 被标记为 vanished,lrelease 丢弃后 .qm 缺失,运行时 tr() 回退英文 2. 方案:将缺失文件全部补入 .pro,用 lupdate 重新生成 deepin-editor.ts / zh_CN / zh_HK / zh_TW。每个语言 16 条 vanished 条目恢复生效并保留原有译文:iflytek 提示 3 条、文件保存错误 提示 8 条(text_file_saver)、Markdown 代码块操作提示 5 条。 并补全全部剩余 unfinished 条目:新增的"Save aborted: editor is closing"提示(简繁三语)及模板 16 条(译文同源串) 3. 影响:语音朗读/听写提示、文件保存错误提示、Markdown 代码块 操作文案恢复正常显示中文(简体与繁体),不涉及代码逻辑与 编译行为。其余语言可经由 Transifex 同步在 .pro 补全后自动恢复。 "视图模式"为源码中已无调用的死条目(已被生效的 "View Mode" 条目取代),已从全部目录中删除 Log: 修复 .pro 缺失源文件导致的提示文案回退英文问题 Influence: 1. 测试禁用音频输出/输入设备时的语音朗读与听写提示 2. 测试大文件/只读文件保存失败时的错误提示文案 3. 测试 Markdown 代码块折叠/展开/复制的提示文案 4. 验证设置页打开/保存位置文案仍为中文(不回退 linuxdeepin#694 的修复) 5. 验证其他已翻译文案不受影响 PMS: BUG-380741
1929dbd to
033b72a
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Root Cause
src/deepin-editor.proSOURCES/HEADERS was missing four files that containtr()calls:common/iflytek_ai_assistant.cpp/.hcommon/text_file_saver.cppeditor/markdown/markdownbridge.hwidgets/pathsettintwgt.cpp/.hlupdatenever scanned these files, so their existing translations were markedtype="vanished"in the.tscatalogs.lreleasedrops vanished entries when generating.qm, so at runtimetr()fell back to English. (CMake usesfile(GLOB)so compilation was unaffected — only the translation pipeline was broken.)Fix
.proHEADERS/SOURCES (7 lines)deepin-editor.ts,_zh_CN.ts,_zh_HK.ts,_zh_TW.tsvialupdate src/deepin-editor.proPer language, 16 vanished entries become active with their existing translations: 3 iflytek + 8 file-save errors + 5 MarkdownBridge.
Verification (done locally with Qt6 lupdate/lrelease)
lreleasebefore: 261 entries in zh_CN.qm, the 16 strings absent; after: 274 entries, all 16 present with correct Chinese (zh_HK/zh_TW likewise)[QObject] 视图模式entry (Chinese-literal source from an old iteration, superseded by the activeView Modeentry) is removedSave aborted: editor is closing(newly discovered by lupdate); all remaining unfinished entries are now filled — the new save-abort prompt is translated in zh_CN/zh_HK/zh_TW and the 16 template entries mirror their source strings (275 finished entries per catalog, 0 unfinished / 0 vanished)Notes
.prois only consumed by the Qt translation toolchain; CMake build unaffectedPMS: BUG-380741