Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Sep 23, 2025

  1. Replace SettingActionButton with AnimationSettingButton in GroupNotify and NotifyHeader components
  2. Add text labels "Fold" and "More" to buttons using qsTr for translation support
  3. Update translation files across 20+ languages to include new text entries
  4. Improve XML formatting in translation files with proper encoding and line breaks
  5. Add Chinese translations for new button labels while marking other languages as unfinished

These changes enhance accessibility by providing text labels for icon- only buttons, making the interface more user-friendly for screen readers and users who prefer text labels. The component switch to AnimationSettingButton suggests improved visual feedback for button interactions.

feat: 为可访问性添加按钮文本标签

  1. 在 GroupNotify 和 NotifyHeader 组件中将 SettingActionButton 替换为 AnimationSettingButton
  2. 使用 qsTr 为按钮添加"折叠"和"更多"文本标签以支持翻译
  3. 更新20多种语言的翻译文件以包含新的文本条目
  4. 改进翻译文件的 XML 格式,使用正确的编码和换行符
  5. 为新的按钮标签添加中文翻译,同时将其他语言标记为未完成

这些更改通过为仅图标按钮提供文本标签来增强可访问性,使界面对屏幕阅读器和
偏好文本标签的用户更加友好。切换到 AnimationSettingButton 组件表明改进了
按钮交互的视觉反馈。

Pms: BUG-283585 BUG-283567

Summary by Sourcery

Add text labels for "Fold" and "More" buttons to improve accessibility, switch to animated buttons for enhanced visual feedback, and update translation files across 20+ languages with proper XML formatting and new entries, including Chinese translations.

New Features:

  • Provide text labels "Fold" and "More" on icon-only action buttons for accessibility

Enhancements:

  • Replace SettingActionButton with AnimationSettingButton in GroupNotify and NotifyHeader for improved interaction feedback
  • Update translation files in over 20 languages with proper XML encoding and formatting, adding new entries for the button labels
  • Include Chinese translations for new labels and mark other languages as unfinished

1. Replace SettingActionButton with AnimationSettingButton in
GroupNotify and NotifyHeader components
2. Add text labels "Fold" and "More" to buttons using qsTr for
translation support
3. Update translation files across 20+ languages to include new text
entries
4. Improve XML formatting in translation files with proper encoding and
line breaks
5. Add Chinese translations for new button labels while marking other
languages as unfinished

These changes enhance accessibility by providing text labels for icon-
only buttons, making the interface more user-friendly for screen
readers and users who prefer text labels. The component switch to
AnimationSettingButton suggests improved visual feedback for button
interactions.

feat: 为可访问性添加按钮文本标签

1. 在 GroupNotify 和 NotifyHeader 组件中将 SettingActionButton 替换为
AnimationSettingButton
2. 使用 qsTr 为按钮添加"折叠"和"更多"文本标签以支持翻译
3. 更新20多种语言的翻译文件以包含新的文本条目
4. 改进翻译文件的 XML 格式,使用正确的编码和换行符
5. 为新的按钮标签添加中文翻译,同时将其他语言标记为未完成

这些更改通过为仅图标按钮提供文本标签来增强可访问性,使界面对屏幕阅读器和
偏好文本标签的用户更加友好。切换到 AnimationSettingButton 组件表明改进了
按钮交互的视觉反馈。

Pms: BUG-283585 BUG-283567
@deepin-ci-robot
Copy link

deepin pr auto review

根据提供的git diff,我来分析一下代码变更并提出改进建议:

  1. 组件变更:
  • SettingActionButton 替换为 AnimationSettingButton
  • 为按钮添加了文本属性(text: qsTr("Fold") 和 text: qsTr("More"))
  • 在翻译文件中添加了 "Fold" 和 "More" 的翻译条目
  1. 代码质量改进:
  • 添加了文本标签提高了按钮的可访问性和可用性
  • 使用 qsTr() 确保文本可以被正确翻译
  • 统一了按钮类型,使用 AnimationSettingButton 替代 SettingActionButton
  1. 潜在问题:
  • 部分语言(如中文)已完成翻译,但其他语言的翻译条目标记为 "unfinished",这可能导致其他语言环境下显示不完整
  • XML 文件中存在格式不一致的情况,有些包含 encoding="utf-8",有些没有
  1. 改进建议:
  • 确保所有语言版本的翻译都完成,避免显示空白文本
  • 统一 XML 文件的格式规范,建议所有翻译文件都包含 encoding="utf-8" 声明
  • 考虑为按钮添加工具提示(tooltip),当用户悬停时提供额外的上下文信息
  • 可以考虑添加动画效果,因为新组件名称中包含 "Animation",但目前代码中没有体现动画相关的实现
  1. 安全性考虑:
  • 检查所有翻译文本是否包含潜在的安全风险,特别是用户输入可能影响显示内容的地方
  • 确保翻译文本不会破坏UI布局,特别是较长的翻译文本
  1. 性能考虑:
  • 确保翻译文件不会影响应用启动性能,可以考虑延迟加载非当前语言的翻译
  • 检查 AnimationSettingButton 组件的性能是否优于原来的 SettingActionButton

总体来说,这次改动提高了界面的可用性和可访问性,但需要确保翻译工作的完整性,并注意保持代码格式的一致性。

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 23, 2025

Reviewer's Guide

This PR enhances accessibility by replacing icon-only buttons with animated buttons that include translatable text labels, and updates translation files (adding new entries and improving XML formatting) across 20+ languages, with Chinese translations completed and others marked unfinished.

Class diagram for button component changes in notification center

classDiagram
    class SettingActionButton {
    }
    class AnimationSettingButton {
        +icon.name
        +text
        +onClicked()
    }
    class GroupNotify {
        +AnimationSettingButton (Fold)
        +AnimationSettingButton (More)
    }
    class NotifyHeader {
        +AnimationSettingButton (Fold)
        +AnimationSettingButton (More)
    }
    SettingActionButton <|-- AnimationSettingButton
    GroupNotify o-- AnimationSettingButton
    NotifyHeader o-- AnimationSettingButton
Loading

File-Level Changes

Change Details Files
Replace icon-only buttons with animated buttons and add text labels
  • Replaced SettingActionButton with AnimationSettingButton in GroupNotify and NotifyHeader
  • Added text properties using qsTr("Fold") and qsTr("More") on collapse and more buttons
panels/notification/center/GroupNotify.qml
panels/notification/center/NotifyHeader.qml
Update base translation file with new entries and XML header formatting
  • Added entries for "Fold" and "More" in the base TS file
  • Inserted encoding="utf-8" and proper DOCTYPE newline
panels/notification/center/translations/org.deepin.ds.notificationcenter.ts
Bulk update of translation TS files for new keys and formatting
  • Added "Fold" and "More" entries marked unfinished across 20+ language files
  • Improved XML formatting (encoding declaration, line breaks) in each TS file
panels/notification/center/translations/org.deepin.ds.notificationcenter_ar.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_az.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_ca.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_de.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_es.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_fi.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_fr.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_hu.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_ja.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_lo.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_nb_NO.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_pl.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_pt_BR.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_sq.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_uk.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_bo.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_it.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_ko.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_ru.ts
Provide completed Chinese translations for new labels
  • Translated "Fold" and "More" into Chinese in simplified, traditional HK and TW files
panels/notification/center/translations/org.deepin.ds.notificationcenter_zh_CN.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_zh_HK.ts
panels/notification/center/translations/org.deepin.ds.notificationcenter_zh_TW.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 there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `panels/notification/center/translations/org.deepin.ds.notificationcenter_az.ts:7-8` </location>
<code_context>
         <source>Clear All</source>
         <translation type="unfinished"></translation>
     </message>
</code_context>

<issue_to_address>
**issue (bug_risk):** Translation for 'Clear All' in Azerbaijani uses Arabic text.

The current translation is in Arabic, not Azerbaijani, and should be corrected to avoid user confusion.
</issue_to_address>

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.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@wjyrich wjyrich merged commit 2cce786 into linuxdeepin:master Sep 23, 2025
10 of 12 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.

4 participants