Skip to content

fix: correct batch print context menu text - #415

Merged
pengfeixx merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/pms-bug-bot/644e735e9ad7
Oct 9, 2026
Merged

pengfeixx merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/pms-bug-bot/644e735e9ad7

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Root Cause Analysis

The right-click context menu for PDF files in the file manager displayed "批量打印" (Batch Print) instead of the required "使用文档查看器批量打印" (Batch Print with Document Viewer). The menu text is defined directly in deepin-reader's context-menu config file (deepin-reader-batchprint.conf), which dde-file-manager reads and displays. The config file's Name and Name[locale] fields were written with abbreviated text that didn't match the specification.

Fix

Updated 4 text fields in src/context-menus/deepin-reader-batchprint.conf to match the required wording: Name, Name[zh_CN], Name[zh_HK], and Name[zh_TW]. No logic changes — only display text.

Change Safety Assessment

Code Safety

  • Risk Level: Low
  • This fix only modifies static display strings in a .conf configuration file; no code logic, function signatures, or call chains are affected.
  • No blame analysis needed — the change is limited to 4 lines of UI text.

Business Impact Scope

Affects the right-click context menu text shown when users select a PDF file in the file manager. The "Batch Print" menu item text changes to include the "Document Viewer" prefix in English, Simplified Chinese, Traditional Chinese (HK), and Traditional Chinese (TW).

Verification Suggestion

  1. Right-click a PDF file in the file manager and verify the menu shows "使用文档查看器批量打印" in zh_CN locale.
  2. Switch to English locale and verify "Batch Print with Document Viewer" appears.
  3. Verify zh_HK and zh_TW locales show correct Traditional Chinese text.

根因分析

文件管理器中右键 PDF 文件时,菜单显示"批量打印"而非需求要求的"使用文档查看器批量打印"。菜单文案由 deepin-reader 的右键菜单配置文件 deepin-reader-batchprint.conf 直接定义,dde-file-manager 读取该配置展示菜单项。配置文件中的 Name 及 Name[locale] 字段使用了简短文案,与需求不一致。

修复方案

修改 src/context-menus/deepin-reader-batchprint.conf 中 4 个文案字段(Name、Name[zh_CN]、Name[zh_HK]、Name[zh_TW]),使文案与需求一致。不涉及任何逻辑改动。

改动安全评估

代码安全评估

  • 风险等级: 低风险
  • 本次修复仅修改 .conf 配置文件中的静态显示文案,不涉及代码逻辑、函数签名或调用链。
  • 无需 blame 分析——改动仅限 4 行 UI 文案。

业务影响范围

影响用户在文件管理器中右键 PDF 文件时看到的"批量打印"菜单项文案。英文、简体中文、繁体中文(香港)和繁体中文(台湾)环境下的菜单文案均会变更为包含"文档查看器"前缀的完整文案。

验证建议

  1. 在文件管理器中右键 PDF 文件,验证 zh_CN 环境下菜单显示"使用文档查看器批量打印"。
  2. 切换到英文环境,验证显示"Batch Print with Document Viewer"。
  3. 验证 zh_HK 和 zh_TW 环境下显示正确的繁体中文文案。

Summary by Sourcery

Bug Fixes:

  • Correct the PDF context-menu labels to identify batch printing through the document viewer across English and Chinese locales.

1. Root cause: context-menu config used "Batch Print" without
   "Document Viewer" prefix; zh_CN/zh_HK/zh_TW all showed "批量打印"
   missing the required prefix per spec
2. Fix: update Name and Name[locale] fields in
   deepin-reader-batchprint.conf to match required text
3. Impact: only menu display text changes, no logic affected

Log: Updated batch print menu text to include Document Viewer

Influence:
1. Verify right-click menu on PDF shows correct text in zh_CN
2. Verify English locale shows "Batch Print with Document Viewer"
3. Verify zh_HK and zh_TW show correct traditional Chinese text

fix: 修正批量打印右键菜单文案

1. 根因:右键菜单配置文件中 Name 字段为"批量打印"/"Batch Print",
   缺少"使用文档查看器"前缀,与需求文案不一致
2. 方案:修改 deepin-reader-batchprint.conf 中 Name 及各 locale 字段,
   使文案与需求一致
3. 影响:仅菜单显示文案变化,不涉及任何逻辑改动

Log: 修正右键菜单批量打印文案为"使用文档查看器批量打印"

Influence:
1. 验证右键PDF文件菜单显示"使用文档查看器批量打印"
2. 验证英文环境下显示"Batch Print with Document Viewer"
3. 验证繁体中文环境显示正确的繁体文案

PMS: BUG-378359
@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates four static Name fields in the deepin-reader context-menu configuration so dde-file-manager displays the required Document Viewer batch-print wording across English, zh_CN, zh_HK, and zh_TW locales; no behavior or execution logic changes.

Sequence diagram for localized batch-print menu display

sequenceDiagram
    participant User
    participant DFM as dde-file-manager
    participant Config as deepin-reader-batchprint.conf

    User->>DFM: Right-click PDF file
    DFM->>Config: Read Name locale field
    Config-->>DFM: Return localized batch-print text
    DFM-->>User: Display Document Viewer batch-print menu
Loading

File-Level Changes

Change Details Files
Correct localized context-menu labels for batch printing PDF and supported document files.
  • Replace the default English label with “Batch Print with Document Viewer”.
  • Update Simplified Chinese, Hong Kong Traditional Chinese, and Taiwan Traditional Chinese labels with the specified wording.
src/context-menus/deepin-reader-batchprint.conf

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交仅修改右键菜单配置文件的显示文案,将"Batch Print"更新为"Batch Print with Document Viewer",将"批量打印"更新为"使用文档查看器批量打印"(含zh_CN/zh_HK/zh_TW三个locale)。变更内容与commit message所述目的一致,仅涉及文案修正,不涉及任何逻辑改动。语法正确,无安全漏洞,无性能问题,代码质量良好。

📋 提交信息

项目 内容
PR linuxdeepin/deepin-reader#415
提交标题 fix: correct batch print context menu text
作者 pengfeixx
修改文件 src/context-menus/deepin-reader-batchprint.conf
PMS关联 BUG-378359

🔍 详细分析

1. 语法逻辑 ✅

评分: 25/25 分 ✓ 通过

评价: 语法正确,逻辑清晰

潜在问题:
✅ 未发现明显问题

分析:

  • 配置文件使用标准的 INI 格式(freedesktop.org desktop entry 规范),语法正确
  • 键值对格式规范,节标题 [Menu Action Zero] 正确
  • 本次变更仅修改 Name 和 Name[locale] 字段的值,未改变任何配置结构
  • 无编译错误,无逻辑缺陷,边界处理不适用(纯文本配置变更)

2. 代码质量 ✅

评分: 25/25 分 ✓ 通过

评价: 代码结构清晰,注释完整

潜在问题:
✅ 未发现明显问题

分析:

  • 配置文件结构合理,字段排列有序
  • 无代码重复,每个 locale 字段独立设置
  • 无残留调试代码
  • locale 翻译一致性检查:
    • Name[zh_CN]=使用文档查看器批量打印 — 简体中文,使用"文档"
    • Name[zh_HK]=使用文檔查看器批量打印 — 香港繁体中文,使用"文檔"(香港繁体用字习惯)
    • Name[zh_TW]=使用文件查看器批量打印 — 台湾繁体中文,使用"文件"(台湾繁体用字习惯)
    • zh_HK 与 zh_TW 的用字差异符合香港和台湾繁体中文的语言习惯,翻译正确

3. 代码性能 ✅

评分: 20/20 分 ✓ 通过

评价: 性能良好,资源使用合理

潜在问题:
✅ 未发现明显问题

分析:

  • 本次变更为配置文件文本修改,不涉及任何算法或逻辑
  • 无性能影响,不涉及系统调用、内存分配或资源使用
  • 变更仅影响菜单显示文案,不影响程序执行流程

4. 代码安全 🔒

评分: 30/30 分 ✓ 通过

评价: 存在0个安全漏洞

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

分析:

  • 安全扫描结果:0 个安全漏洞
  • 本次变更仅修改显示文本,不涉及用户输入处理
  • Exec=deepin-reader-batchprint %F 行未变更,使用标准 freedesktop.org 规范的 %F 参数替换,无命令注入风险
  • 无敏感信息泄露,无硬编码密钥
  • 无路径遍历、SQL注入、XSS等安全风险
  • OCR审查结果:0个安全漏洞(OCR因commit未在克隆分支中找到而未成功执行)

📝 变更详情

行号 字段 修改前 修改后 说明
9 Name Batch Print Batch Print with Document Viewer 英文菜单增加"Document Viewer"前缀
16 Name[zh_CN] 批量打印 使用文档查看器批量打印 简体中文增加"使用文档查看器"前缀
17 Name[zh_HK] 批量打印 使用文檔查看器批量打印 香港繁体增加前缀,用字"文檔"
18 Name[zh_TW] 批量打印 使用文件查看器批量打印 台湾繁体增加前缀,用字"文件"

💡 改进建议

本次变更质量良好,无需额外改进。变更与 commit message 所述目的完全一致,仅涉及菜单显示文案修正,不涉及任何逻辑改动。


📊 评分汇总

维度 评分 满分 状态
语法逻辑 25 25 ✅ 通过
代码质量 25 25 ✅ 通过
代码性能 20 20 ✅ 通过
代码安全 30 30 ✅ 通过
总分 100 100 ✅ 通过

本报告由 AI 代码审查工具自动生成
扫描时间: 2026-10-09 09:45:00

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pengfeixx
pengfeixx merged commit 97457f8 into linuxdeepin:master Oct 9, 2026
6 of 9 checks passed
@pengfeixx
pengfeixx deleted the agent/pms-bug-bot/644e735e9ad7 branch October 9, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants