-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Show message when moving between components while translating #14921
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
nijel
left a comment
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.
Do you see a reasonable way to make it work without passing this info in request? The long-term plan is to use unit URLs while navigating (see #9953).
weblate/trans/views/edit.py
Outdated
| messages.error(request, gettext("Invalid search string!")) | ||
| return redirect(obj) | ||
|
|
||
| from_offset = int(request.GET.get("from_offset", offset - 1)) |
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.
This will crash with a blank value (form_offset=).
weblate/trans/views/edit.py
Outdated
| gettext("You have shifted from %(previous)s to %(current)s.") | ||
| % { | ||
| "previous": previous_unit.translation.component.name, | ||
| "current": unit.translation.component.name, |
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.
Name is not good enough here as it does not have to be unique, at least categories should be included. Perhaps using full component name including project would be better for consistency with other views.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14921 +/- ##
==========================================
+ Coverage 91.10% 91.14% +0.03%
==========================================
Files 624 626 +2
Lines 65338 65476 +138
Branches 6746 6753 +7
==========================================
+ Hits 59527 59676 +149
+ Misses 4077 4069 -8
+ Partials 1734 1731 -3
🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
weblate/trans/views/edit.py
Outdated
| int(request.session["previous_unit_id"]) | ||
| if "previous_unit_id" in request.session | ||
| else None | ||
| ) |
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.
This should be pinned to the search result; otherwise it will have too many corner cases:
- Translating one project, then starting translating another project would yield the message.
- Opening multiple translation tabs they will fight for the same previous_unit_id.
It could be stored inside the search data, which we already have in the search function above.
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.
okay
|
Merged, thanks for your contribution! |
Fixes #14798
When translating on category or project level, make user aware if the component of unit changes.