phplist3 icon indicating copy to clipboard operation
phplist3 copied to clipboard

Better support for non-latin strings in select dropdown of search subcribers page

Open arius28 opened this issue 2 years ago • 3 comments

I am using phpList along with attributes in the Greek language and in the search subscribers section the filtering dropdown which shows the available attributes doesn't correctly truncate Greek strings due to the substr command.

I propose to change it with the function shortenTextDisplay (defined in lib.php) which uses the corresponding mb_ versions for substr etc. if available.

Before: phplist_2

After: phplist_1

arius28 avatar Jun 30 '22 11:06 arius28

Hey @michield,

I agree. Per @bramley 's observation my pull request should then be amended and make use of shortenText as implemented in his pull request to avoid adding the span element. Should i push a new commit?

arius28 avatar Sep 19 '22 12:09 arius28

Well, having a span inside an LI is perfectly valid, so I think it' s fine as it is. Looking at it more closely, the substr returns the first X characters, where shortentextdisplay returns the first X number of characters followed by ... followed by the last number of Y characters, so the effect is different.

The result is acceptable though. The main aim is to avoid creating a very wide dropdown, which would render badly particularly on mobile.

michield avatar Sep 19 '22 12:09 michield

From what I see though, the dropdown in question is a simple SELECT tag with OPTIONS so isn't adding a span there invalid? Chrome/firefox browsers seem to work OK with it since it looks like they tidy up, keeping the text and getting rid of the span tag but is it a sure thing?

arius28 avatar Sep 19 '22 13:09 arius28

This pull request has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/3-6-9-release-candidate-ready-for-testing/8445/1

phpListDockerBot avatar Sep 30 '22 11:09 phpListDockerBot

This pull request has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/phplist-3-6-9-is-available-for-download/8474/1

phpListDockerBot avatar Oct 20 '22 15:10 phpListDockerBot