Skip to content

Commit 1929dbd

Browse files
committed
fix: add missing tr() sources to .pro and regenerate translations
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) 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 #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 条 3. 影响:语音朗读/听写提示、文件保存错误提示、Markdown 代码块 操作文案恢复正常显示中文(简体与繁体),不涉及代码逻辑与 编译行为。其余语言可经由 Transifex 同步在 .pro 补全后自动恢复。 "视图模式"为源码中已无调用的死条目(已被生效的 "View Mode" 条目取代),已从全部目录中删除 Log: 修复 .pro 缺失源文件导致的提示文案回退英文问题 Influence: 1. 测试禁用音频输出/输入设备时的语音朗读与听写提示 2. 测试大文件/只读文件保存失败时的错误提示文案 3. 测试 Markdown 代码块折叠/展开/复制的提示文案 4. 验证设置页打开/保存位置文案仍为中文(不回退 #694 的修复) 5. 验证其他已翻译文案不受影响 PMS: BUG-380741
1 parent 1a2f7c1 commit 1929dbd

5 files changed

Lines changed: 1337 additions & 1239 deletions

File tree

‎src/deepin-editor.pro‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ HEADERS += editor/bookmarkwidget.h \
3434
editor/linenumberarea.h \
3535
editor/showflodcodewidget.h \
3636
editor/uncommentselection.h \
37+
editor/markdown/markdownbridge.h \
3738
encodes/detectcode.h \
3839
common/comment_global.h \
3940
common/common.h \
@@ -44,6 +45,8 @@ HEADERS += editor/bookmarkwidget.h \
4445
common/settings.h \
4546
common/urlinfo.h \
4647
common/utils.h \
48+
common/iflytek_ai_assistant.h \
49+
common/text_file_saver.h \
4750
controls/findbar.h \
4851
controls/fontitemdelegate.h \
4952
controls/jumplinebar.h \
@@ -61,6 +64,7 @@ HEADERS += editor/bookmarkwidget.h \
6164
widgets/ColorSelectWdg.h \
6265
widgets/ddropdownmenu.h \
6366
widgets/window.h \
67+
widgets/pathsettintwgt.h \
6468
editorapplication.h \
6569
environments.h \
6670
startmanager.h
@@ -80,6 +84,8 @@ SOURCES += editor/bookmarkwidget.cpp \
8084
common/performancemonitor.cpp \
8185
common/settings.cpp \
8286
common/utils.cpp \
87+
common/iflytek_ai_assistant.cpp \
88+
common/text_file_saver.cpp \
8389
controls/findbar.cpp \
8490
controls/fontitemdelegate.cpp \
8591
controls/jumplinebar.cpp \
@@ -98,6 +104,7 @@ SOURCES += editor/bookmarkwidget.cpp \
98104
widgets/ColorSelectWdg.cpp \
99105
widgets/ddropdownmenu.cpp \
100106
widgets/window.cpp \
107+
widgets/pathsettintwgt.cpp \
101108
editorapplication.cpp \
102109
startmanager.cpp \
103110
main.cpp

0 commit comments

Comments
 (0)