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

Project Translation considers descriptions of Value Map Widget #60744

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

signedav
Copy link
Contributor

@signedav signedav commented Feb 25, 2025

Value Map descriptions can now be translated as well.

This loaded with EN settings ...becomes this loaded with DE settings
image image

The values are of course the same.

This fixes #56089

Additionally I included missing tests for the Value Relation value translation.
The ts file is committed as well, so the tests can be extended in future with low effort.

This handles only value maps stored as QLists (means after this implementation #6091 and > 3.4)

@github-actions github-actions bot added this to the 3.44.0 milestone Feb 25, 2025
Copy link

github-actions bot commented Feb 25, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 8a98242)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 8a98242)

@signedav signedav closed this Feb 25, 2025
@signedav signedav reopened this Feb 25, 2025
Copy link
Member

@3nids 3nids left a comment

Choose a reason for hiding this comment

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

LGTM!

const QList<QVariant> valueList = field.editorWidgetSetup().config().value( QStringLiteral( "map" ) ).toList();

for ( int i = 0, row = 0; i < valueList.count(); i++, row++ )
if ( field.editorWidgetSetup().config().value( QStringLiteral( "map" ) ).canConvert<QList<QVariant>>() )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Beside using QList consequently I added this line. Otherwise it would just had returned an empty list, but with this it's cleaner...

@signedav
Copy link
Contributor Author

Thanks @3nids

@signedav signedav merged commit 0db48e1 into qgis:master Feb 27, 2025
32 checks passed
@qgis-bot
Copy link
Collaborator

The backport to queued_ltr_backports failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 5d63c80a292... ValueMap description are translated in project translation process. Fixes #56089
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging src/core/project/qgsproject.cpp
Auto-merging src/core/vector/qgsvectorlayer.cpp
Auto-merging src/gui/vector/qgsattributesformproperties.cpp
CONFLICT (content): Merge conflict in src/gui/vector/qgsattributesformproperties.cpp

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-queued_ltr_backports queued_ltr_backports
# Navigate to the new working tree
cd .worktrees/backport-queued_ltr_backports
# Create a new branch
git switch --create backport-60744-to-queued_ltr_backports
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 5d63c80a2921b1016bb5ee0d3d5b80522f48aa0c,864543becddf470d2d375e776d61321c7b4e8a95,529d85b3d95170e2ef8a1495c6091650335e0bb3,dcab0217709aa4e21cc7a8229f173945d4da07b5,8a982428f40e7ea95568037241cf2a17ad2ed004
# Push it to GitHub
git push --set-upstream origin backport-60744-to-queued_ltr_backports
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-queued_ltr_backports

Then, create a pull request where the base branch is queued_ltr_backports and the compare/head branch is backport-60744-to-queued_ltr_backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport queued_ltr_backports Queued Backports backport release-3_42 failed backport The automated backport attempt failed, needs a manual backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Value maps definition in attribute widget are not translated
3 participants