Download & Extend

Fold in moderation page to translation page properly

Project:Localization server
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Gábor Hojtsy
Status:closed (fixed)

Issue Summary

Konstantin attempted to throw out the moderation page in the initial revised UI patch (#563128: Rework the translation UI) given that the revised UI now presents all suggestions as well. Suggestions are now a prominent part of the UI, so it seemed logical to drop the moderation UI. The translation page lists suggestions, has checkboxes to decline and radio buttons to approve them. So it presents all the functionality of the moderation page plus lots of other niceties like diffs, putting suggestions into context (with other suggestions), etc.

BUT the translation page did not allow people to search in suggestions, filter suggestions per user, etc. Basically the translate page filters (user name, contains text filter) only looked at the source string and the translation, the moderation filters only looked at the source and the suggestion. This is the only remaining difference in terms of functionality, but given the new UI, the translate page run ahead pretty far of the moderation UI.

So the solution turns out we need to add support to search in suggestions as well on the translate page. In fact, since the suggestions are displayed on the "top level", I'd argue users will expect that suggestions are looked at in searches already. They are not. So looks like our new preferred default would be that the filters look at both the translations and suggestions.

To solve this, I'd needed a "has_translation" flag beyond the existing "has_suggestion" one. However, has_suggestion is only meaningful on active translations, while has_translation would only be meaningful on active suggestions. Looks bad. So I decided we'd need to refactor these flags to their own table. This way we can search in suggestions and still look at the flags joined side by side and avoid the mock empty translations we had occasionally before.

However, we need to initialize and track any changes to values of has_suggestion and has_translation flags. This is done in an update function and in the extractor code as well as the admin cleanup functionality.

All is visible of this is that the UI got two new options in the status filters: "is translation" and "is suggestion". Previously, basically the code had "is translation" hard-wired. Now you can set both to Any and get search both in suggestions and translations at the same time or restrict search to either just translations (as before) or just suggestions (as the moderation screen did):

Finally, there was unfortunate code duplication for the ways to save translations. Import and remote submission used one function while translation UI used a set of other functions. Because this later set of functions better reflects assumptions we make about the workflow now, I migrated the other two places to use these and removed the existing ones.

Removing the moderation screen also helped us remove some string formatting functions and the newline image, which were only used there by now.

We had extensive testing for the moderation page, but now its just a special option of the translation page, so same tests apply. However, test using the translation page to approve and decline strings needed to be updated. I've extended them to approve and decline multiple things, so we test this functionality better.

AttachmentSizeStatusTest resultOperations
fold-in-moderation-page.patch78.16 KBTest request sentNoneView details
IsSuggestion.png19.88 KBIgnored: Check issue status.NoneNone

Comments

#1

Ok, with the new integrated suggestion search, the need to highlight actual results became ever more important. (We've already received questions as to what exactly is matched). So I decided to put in a bit of code to mark stuff matched with a subtle bezel.

Basically, now you could match source strings, translations AND suggestions. This new item is new. But while you might match 2 of the 10 suggestions for a string, both the current translation and all 10 suggestions will be displayed. So highlighting which ones matched looks to be important.

In this example, I'm searching for stuff containing "invalid" by used "admin". All translations/suggestions are highlighted which are by "admin" and contains "invalid". Plus all suggestions/translations are highlighted which are by "admin" and are for a source string which contains "invalid". So the string either should appear in the source or the target to match, the user should appear in the target. This basic concept is how it *always* worked, the new stuff here is that suggestions are also searched in.

This is how my sample result looks:

AttachmentSizeStatusTest resultOperations
InvalidByAdmin.png115.02 KBIgnored: Check issue status.NoneNone
fold-in-moderation-page.patch84.83 KBTest request sentNoneView details

#2

Status:needs review» fixed

Committed in the interest of making some rapid progress here.

#3

Well, this last search marker change also affected tests, but I did not run them properly before commit. My bad. This attached patch now fixes the tests. Committing.

AttachmentSizeStatusTest resultOperations
search-class-change.patch2.33 KBIgnored: Check issue status.NoneNone

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here