Problem/Motivation
At /admin/config/regional/translate, there is a string filter for finding translations. It defaults to a "contains" comparison operator, which is right for most situations, admittedly. But we recently ran into an issue in which we needed to find a specific short string that is common in several longer strings and it returned pages and pages of results.
Steps to reproduce
Go here: /admin/config/regional/translate
Note that it isn't possible to filter the list by
Attempt to filter the list to show
Proposed resolution
A views-like comparison operator within core/modules/locale/src/Form/TranslateFormBase.php would be a fantastic new feature.
Remaining tasks
Built the UI change.Add test coverage.
User interface changes
On the translation admin page it will be possible to select whether the keyword search is for an exact match (default, to match existing functionality) or a partial match.
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal-n2940443-18-101x.patch | 6.31 KB | DamienMcKenna |
| |||
#15 | drupal-n2940443-13-updated-php8.patch | 6.3 KB | a.sotirov |
#11 | drupal-n2940443-11.patch | 6.38 KB | DamienMcKenna |
Comments
Comment #7
ericdsd CreditAttribution: ericdsd commentedI agree with @ryangibson, it would be a really useful feature tu have a "contains / starts by / exact match" filter in interface translation form. As this would make it really painless to search for short strings eg. when you have to search for a string like "for". A case insensitive option would also be nice to have.
Comment #9
DamienMcKennaWorking on this.
Comment #10
DamienMcKennaThis provides a new option "Operation" on the user interface translation page:
Next off: test coverage.
Comment #11
DamienMcKennaNow with test coverage.
Comment #12
ericdsd CreditAttribution: ericdsd commentedTested over 9.2.6, it works like a charm. This is a real step forward to have "equals" operator thanks a lot for your work, including "starts with" and "ends with" would be a real nice to have enhancement though.
Comment #15
a.sotirov CreditAttribution: a.sotirov at FFW commentedHello. I just did some updates of patch No:11 due to some php8 fixes.
Comment #17
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
Doing a file comparison seems #15 is the same as #11. Also @a.sotirov please upload an interdiff so we can see the changes.
At this time we would need a D10.1.x patch or MR for this issue based on #11
Testing out the changes though manually.
I am seeing an operator selector now on /admin/config/regional/translate with options "Contains" and "Equals"
Tested that it works as expected.
Verified the tests attached to patch #11 fail without the fix.
Tagging for issue summary update if someone could put the solution in the summary for the committer.
And for the 10.1.x patch.
Comment #18
DamienMcKennaRerolled for 10.1.x.
Comment #19
smustgrave CreditAttribution: smustgrave at Mobomo commentedThank you for the quick turnaround!
Comment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedRandom ckeditor
Comment #22
quietone CreditAttribution: quietone at PreviousNext commentedThis issue is changing the user interface, so I am adding the usability tag per Tag issues with 'usability'.
Issue changing the user interface should have before and after screenshots available from the Issue Summary. And lets get a UX review, adding tag.