Skip to content
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

style shortcuts translated and hierarchicalised in prefs/dialog #18332

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

dterrahe
Copy link
Member

@dterrahe dterrahe commented Feb 1, 2025

fixes #18325

while testing this I'm getting bitten quite badly by #18196; only a part of the style tree ends up getting localized. Switching off setlocale in the opencl code fixes it.

Renaming or deleting presets (and presumably styles) while in non-English ends up not finding/removing the previous associated action. Still needs fixing.

@TurboGit
Copy link
Member

TurboGit commented Feb 1, 2025

I haven't seen this while I was finalizing my PR :)

@TurboGit
Copy link
Member

TurboGit commented Feb 1, 2025

Tested, for the preference it is all good.

The only remaining issue is the non translated name displayed to the user via the control log in dt_styles_apply_to_dev at the end of the routine. This is working on my PR because I'm also using the internal hash-table, maybe you can do better?

@dterrahe
Copy link
Member Author

dterrahe commented Feb 5, 2025

Remaining issue with style toast resolved in first commit

Second commit adds hierarchical menus for processing module presets and also changes their names to l10n format so that shortcuts don't break when changing languages. (For now, I haven't attempted to retain existing shortcuts so they'll all be dropped).

There are remaining issues, especially where treeviews and dialogs assume there is no difference between the internal and displayed/translated names. So when editing a preset, the translated name is presented, but then when saving that doesn't match the existing preset (if there are multiple levels divided by |) because the translated name contains " | " rather than just "|" (space before and after). Another issue, that is dealt with, but with consequences, is that internally contextualized translations (C_() or NC_()) are represented by "context|text". This is how Gtk does it. But | is now also used for hierarchies. So internally a context marker is changed to ^ and later changed back just before translating. If a user intentionally puts ^ in a string marked for translation with l10n they may not realise this will be interpreted as a context marker.

@dterrahe
Copy link
Member Author

dterrahe commented Feb 5, 2025

On second thought, just introducing the hierarchical submenus for processing module presets. In the module hamburger menu only, not for the "favorite presets", because I think people would insert | if they have many per-module presets, but then don't want that to lead to a long list of one-item submodules in the favorite menu (where they would anyway only put the most-used ones).

This does not include the translation work on presets yet (i.e. to make the internal representation, which is linked to shortcuts, be independent of the chosen language so that shortcuts don't break when switching. That's still a more involved change that requires a lot of testing and feedback.

@TurboGit I think this is ready.

@TurboGit TurboGit added this to the 5.2 milestone Feb 6, 2025
@TurboGit TurboGit added bugfix pull request fixing a bug feature: enhancement current features to improve scope: translation / strings make darktable international priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: UI user interface and interactions scope: DAM managing files, collections, archiving, metadata, etc. release notes: pending labels Feb 6, 2025
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

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

Thanks!

@TurboGit TurboGit merged commit fac0c63 into darktable-org:master Feb 6, 2025
6 checks passed
@dterrahe
Copy link
Member Author

dterrahe commented Feb 7, 2025

Release notes:

  • presets can now be arranged in sub menus, like styles can, by inserting | in their name between levels. The shortcuts dialog/preferences tab now show these collapsible hierarchies for styles and presets too (and the bug that style shortcuts were not translated is fixed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug feature: enhancement current features to improve priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: DAM managing files, collections, archiving, metadata, etc. scope: translation / strings make darktable international scope: UI user interface and interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

styles global preference cannot be translated
2 participants