Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Jun 4, 2025

as title.

Log:

Summary by Sourcery

Update translation files for dock and notification panels: standardize TS XML headers and formatting, and add missing localization entries.

New Features:

  • Add "Lock the Dock" translation key in the dock settings across all languages
  • Introduce translation entries for Dock taskmanager global actions: Open, Undock, Dock, Force Quit, and Close All

Enhancements:

  • Normalize TS XML headers by adding encoding declarations and separate DOCTYPE lines
  • Convert self-closing tags to explicit open/close tags and ensure proper language attributes in TS files

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码格式:提交的代码中,所有的XML文件都缺少了<?xml version="1.0" encoding="utf-8"?>声明,这可能会导致XML文件解析错误。建议在所有XML文件的开头添加这个声明。

  2. 翻译未完成:代码中存在一些翻译为<translation type="unfinished"></translation>的情况,这表示翻译尚未完成。建议完成所有翻译,或者将<translation>标签中的内容替换为实际的翻译文本。

  3. 语言编码:在org.deepin.ds.dock.ts文件中,<TS version="2.1" language="_CN">可能是一个错误,因为_CN并不是一个有效的语言代码。建议使用正确的语言代码,如zh_CN

  4. 重复代码:提交的代码中,存在多个文件具有相同的翻译内容,这可能是由于复制粘贴造成的。建议检查这些文件,确保每个文件中的翻译内容都是唯一的。

  5. 注释:代码中没有添加任何注释,这可能会影响代码的可读性。建议在适当的地方添加注释,解释代码的功能和逻辑。

  6. 文件命名:提交的代码中,文件名org.deepin.ds.dock.taskmanager_zh_CN.tsorg.deepin.ds.dock.taskmanager_zh_HK.ts可能存在拼写错误,建议检查并修正文件名。

  7. 版本控制:提交的代码中,版本控制信息(如indexcommit哈希值)被删除了,这可能会影响代码的版本控制。建议保留版本控制信息。

  8. 文件权限:提交的代码中,文件权限被修改了,这可能会导致文件无法正确读取或写入。建议检查并恢复文件的原始权限。

  9. 文件内容:提交的代码中,文件内容没有变化,这可能是一个误提交。建议检查代码是否有实际修改,或者是否需要重新提交。

  10. 文件结构:提交的代码中,文件结构可能需要调整,以更好地组织和管理代码。建议检查文件结构,确保代码的模块化和可维护性。

以上是针对提交的代码的一些初步审查意见,具体的改进建议可能需要根据代码的具体功能和上下文来确定。

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 4, 2025

Reviewer's Guide

This PR standardizes TS file formatting across multiple translation files, introduces the new “Lock the Dock” string in dock settings, and extends the taskmanager translations with a new global-element context for common actions.

Class Diagram: New and Updated Translatable String Contexts

classDiagram
    title Class Diagram: New and Updated Translatable String Contexts
    class DockSettingsStrings {
        +String Indicator Style
        +String Fashion Mode
        +String Efficient Mode
        +String Classic Mode
        +String Status
        +String Position
        +String Mode
        +String Display Mode
        +String Keep Shown
        +String Keep Hidden
        +String Smart Hide
        +String Dock Settings
        +String Lock the Dock (new)
    }

    class DockGlobalElementModelStrings {
        +String Open (new)
        +String Undock (new)
        +String Dock (new)
        +String Force Quit (new)
        +String Close All (new)
    }
Loading

File-Level Changes

Change Details Files
Normalize TS file headers and translation tag formatting
  • Add encoding="utf-8" to XML declarations and split DOCTYPE onto its own line
  • Convert self-closing tags into explicit open/close elements
  • Ensure files end with a newline where missing
panels/dock/translations/*.ts
panels/dock/taskmanager/translations/*.ts
panels/notification/**/translations/*.ts
Add new “Lock the Dock” entry to dock translation files
  • Insert a block for “Lock the Dock” under the main context
  • Mark translations as unfinished (or provide existing localized strings where available)
panels/dock/translations/org.deepin.ds.dock*.ts
Introduce dock::DockGlobalElementModel context in taskmanager translations
  • Add a new for DockGlobalElementModel
  • Include messages for Open, Undock, Dock, Force Quit, and Close All
panels/dock/taskmanager/translations/org.deepin.ds.dock.taskmanager_*.ts

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @wjyrich - I've reviewed your changes - here's some feedback:

  • In panels/dock/translations/org.deepin.ds.dock.ts you’ve set the TS language attribute to “_CN”, which looks unintended—please remove or correct it so the base TS remains locale-neutral.
  • Several TS files were updated with new XML headers but still lack a final newline—please ensure consistent XML declarations and end-of-file newlines to avoid parser errors.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@wjyrich wjyrich force-pushed the add-translation-fix branch from 891d72c to 3a3311a Compare June 5, 2025 01:04
@deepin-ci-robot
Copy link

@wjyrich: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
deepin-auto-translation 3a3311a link true /test deepin-auto-translation

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, wjyrich

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

@BLumia BLumia merged commit 1ac10db into linuxdeepin:master Jun 5, 2025
7 of 11 checks passed
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