-
Notifications
You must be signed in to change notification settings - Fork 57
sync: from linuxdeepin/dde-session-shell #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#43
Reviewer's GuideThis PR syncs upstream changes from linuxdeepin/dde-session-shell by adding a new utility to convert dash-separated strings to camelCase, adjusting lockframe event handling to use this utility conditionally, cleaning up plugin build configuration, importing new Spanish translation templates, and updating reuse metadata. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review根据提供的git diff内容,我来分析一下代码变更并提出改进建议:
这些改进建议旨在提高代码质量、性能和可维护性,同时确保代码的安全性和可靠性。 |
There was a problem hiding this 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 - here's some feedback:
- Wrap the new qtifyName function in an existing namespace (e.g. global_util or dss) instead of placing it in the global namespace.
- Consider simplifying the dash-to-camelCase logic by using QString::split/join or a QRegularExpression rather than a manual character loop.
- The ENABLE_DSS_SNIPE guard around sendKeyValue is scattered; consolidating or documenting its purpose could improve readability and maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Wrap the new qtifyName function in an existing namespace (e.g. global_util or dss) instead of placing it in the global namespace.
- Consider simplifying the dash-to-camelCase logic by using QString::split/join or a QRegularExpression rather than a manual character loop.
- The ENABLE_DSS_SNIPE guard around sendKeyValue is scattered; consolidating or documenting its purpose could improve readability and maintainability.
## Individual Comments
### Comment 1
<location> `translations/dde-session-shell_es_AR.ts:1` </location>
<code_context>
+<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="es_AR">
+<context>
+ <name>AuthFace</name>
</code_context>
<issue_to_address>
Consider consolidating identical Spanish translation files into a single base file and using small override files for regional differences.
Consider collapsing all of the identical `<TS … language="es_XX">` files into one base `es` file and then only shipping tiny “override” files for the locales that actually differ. Qt will merge them at runtime if you load them in order.
1. Rename your big `es_AR.ts` into a single full `es.ts`:
```xml
<?xml version="1.0" ?><!DOCTYPE TS>
<TS version="2.1" language="es">
<context>
<name>AuthFace</name>
<message>
<source>Face ID</source>
<translation>Face ID</translation>
</message>
<!-- … all 571 messages … -->
</context>
<!-- … other contexts … -->
</TS>
```
2. Create an *override* file for Argentina only containing the strings that actually change (if there are none yet you can skip it completely):
```xml
<?xml version="1.0" ?><!DOCTYPE TS>
<TS version="2.1" language="es_AR">
<context>
<name>AuthFace</name>
<message>
<source>Face ID</source>
<translation>ID de rostro</translation>
</message>
</context>
<!-- only contexts/messages that differ -->
</TS>
```
3. Load them in your `main.cpp` (or wherever you install translators) in the right order:
```cpp
QTranslator base;
base.load(":/i18n/app_es.qm");
app.installTranslator(&base);
QTranslator regional;
if (QLocale::system().name() == "es_AR") {
regional.load(":/i18n/app_es_AR.qm");
app.installTranslator(®ional);
}
```
This way you maintain **one** full Spanish file and only ship tiny diffs for each region, greatly reducing duplication.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| @@ -0,0 +1,571 @@ | |||
| <?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="es_AR"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider consolidating identical Spanish translation files into a single base file and using small override files for regional differences.
Consider collapsing all of the identical <TS … language="es_XX"> files into one base es file and then only shipping tiny “override” files for the locales that actually differ. Qt will merge them at runtime if you load them in order.
-
Rename your big
es_AR.tsinto a single fulles.ts:<?xml version="1.0" ?><!DOCTYPE TS> <TS version="2.1" language="es"> <context> <name>AuthFace</name> <message> <source>Face ID</source> <translation>Face ID</translation> </message> <!-- … all 571 messages … --> </context> <!-- … other contexts … --> </TS>
-
Create an override file for Argentina only containing the strings that actually change (if there are none yet you can skip it completely):
<?xml version="1.0" ?><!DOCTYPE TS> <TS version="2.1" language="es_AR"> <context> <name>AuthFace</name> <message> <source>Face ID</source> <translation>ID de rostro</translation> </message> </context> <!-- only contexts/messages that differ --> </TS>
-
Load them in your
main.cpp(or wherever you install translators) in the right order:QTranslator base; base.load(":/i18n/app_es.qm"); app.installTranslator(&base); QTranslator regional; if (QLocale::system().name() == "es_AR") { regional.load(":/i18n/app_es_AR.qm"); app.installTranslator(®ional); }
This way you maintain one full Spanish file and only ship tiny diffs for each region, greatly reducing duplication.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot, yixinshark 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 |
Synchronize source files from linuxdeepin/dde-session-shell.
Source-pull-request: linuxdeepin/dde-session-shell#43
Summary by Sourcery
Synchronize upstream changes from linuxdeepin/dde-session-shell by introducing a camelCase conversion helper with conditional use in key event emission, cleaning up CMake plugin entries, adding new Spanish locale translation templates, and updating reuse metadata.
New Features:
Enhancements:
Documentation:
Chores: