Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Spaces before or after a string that you search to translate returns nothing.
Steps to reproduce
1. Install the "Interface Translation" (locale) module.
2. Go to /admin/config/regional/translate
3. Search for "More " with two spaces before or after.
Proposed resolution
Use php trim function to remove space from search string value.
Comment | File | Size | Author |
---|---|---|---|
#10 | 3179258-6.patch | 1.54 KB | julien |
#6 | 3179258-5.patch | 1.54 KB | julien |
#4 | 3179258-4.patch | 1.41 KB | paulocs |
#4 | 3179258-4-test-only.patch | 694 bytes | paulocs |
#2 | 3179258-1.patch | 748 bytes | julien |
Comments
Comment #2
julien CreditAttribution: julien commentedComment #3
paulocsWe should add test for it.
I'll do it.
Comment #4
paulocsTagging the Bug smash initiative and adding test case.
Comment #6
julien CreditAttribution: julien commentedUpdated the test to use a variable name_ws with whitespace, which would be trimed, and assert that name is in the results.
Comment #7
julien CreditAttribution: julien commentedComment #8
paulocsLooks good!
Comment #9
quietone CreditAttribution: quietone as a volunteer commentedThis change is suitable for a novice.
s/to ensure that it's finded./to ensure it is found./
The past tense of find is found.
Comment #10
julien CreditAttribution: julien commentedComment #11
paulocsMoving to RTBC as patch #10 fixes what @quietone pointed on comment #9.
Comment #13
larowlanCommitted d598f54 and pushed to 9.2.x. Thanks
Leaving as RTBC and moving to 9.1.x for possible backport after the code-freeze is finished.
Comment #14
alexpottSure let's backport this. Makes the search a bit more lenient which is a nicer UX.